Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/PPublic

Commit57aeff4

Browse files
committed
Fix string comparison in PChecker runtime
Fix the implementation of PString in the checker runtime to computestring ordering correctly.
1 parent369b8a9 commit57aeff4

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

‎Src/PChecker/CheckerCore/Runtime/Values/PString.cs‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,73 +92,73 @@ private PString(string value)
9292
[MethodImpl(MethodImplOptions.AggressiveInlining)]
9393
publicstaticPBooloperator<(inPStringpString1,inPStringpString2)
9494
{
95-
returnstring.Compare(pString1.value,pString2.value)==-1;
95+
returnstring.Compare(pString1.value,pString2.value)<0;
9696
}
9797

9898
[MethodImpl(MethodImplOptions.AggressiveInlining)]
9999
publicstaticPBooloperator<(inIPValuepValue1,inPStringpValue2)
100100
{
101-
returnpValue1isPStringpString&&string.Compare(pString.value,pValue2.value)==-1;
101+
returnpValue1isPStringpString&&string.Compare(pString.value,pValue2.value)<0;
102102
}
103103

104104
[MethodImpl(MethodImplOptions.AggressiveInlining)]
105105
publicstaticPBooloperator<(inPStringpValue1,inIPValuepValue2)
106106
{
107-
returnpValue2isPStringpString&&string.Compare(pString.value,pValue1.value)==-1;
107+
returnpValue2isPStringpString&&string.Compare(pString.value,pValue1.value)<0;
108108
}
109109

110110
[MethodImpl(MethodImplOptions.AggressiveInlining)]
111111
publicstaticPBooloperator>(inPStringpString1,inPStringpString2)
112112
{
113-
returnstring.Compare(pString1.value,pString2.value)==1;
113+
returnstring.Compare(pString1.value,pString2.value)>0;
114114
}
115115

116116
[MethodImpl(MethodImplOptions.AggressiveInlining)]
117117
publicstaticPBooloperator>(inIPValuepValue1,inPStringpValue2)
118118
{
119-
returnpValue1isPStringpString&&string.Compare(pString.value,pValue2.value)==1;
119+
returnpValue1isPStringpString&&string.Compare(pString.value,pValue2.value)>0;
120120
}
121121

122122
[MethodImpl(MethodImplOptions.AggressiveInlining)]
123123
publicstaticPBooloperator>(inPStringpValue1,inIPValuepValue2)
124124
{
125-
returnpValue2isPStringpString&&string.Compare(pString.value,pValue1.value)==1;
125+
returnpValue2isPStringpString&&string.Compare(pString.value,pValue1.value)>0;
126126
}
127127

128128
[MethodImpl(MethodImplOptions.AggressiveInlining)]
129129
publicstaticPBooloperator<=(inPStringpString1,inPStringpString2)
130130
{
131-
returnstring.Compare(pString1.value,pString2.value)!=1;
131+
returnstring.Compare(pString1.value,pString2.value)<=0;
132132
}
133133

134134
[MethodImpl(MethodImplOptions.AggressiveInlining)]
135135
publicstaticPBooloperator<=(inIPValuepValue1,inPStringpValue2)
136136
{
137-
returnpValue1isPStringpString&&string.Compare(pString.value,pValue2.value)!=1;
137+
returnpValue1isPStringpString&&string.Compare(pString.value,pValue2.value)<=0;
138138
}
139139

140140
[MethodImpl(MethodImplOptions.AggressiveInlining)]
141141
publicstaticPBooloperator<=(inPStringpValue1,inIPValuepValue2)
142142
{
143-
returnpValue2isPStringpString&&string.Compare(pString.value,pValue1.value)!=1;
143+
returnpValue2isPStringpString&&string.Compare(pString.value,pValue1.value)<=0;
144144
}
145145

146146
[MethodImpl(MethodImplOptions.AggressiveInlining)]
147147
publicstaticPBooloperator>=(inPStringpString1,inPStringpString2)
148148
{
149-
returnstring.Compare(pString1.value,pString2.value)!=-1;
149+
returnstring.Compare(pString1.value,pString2.value)>=0;
150150
}
151151

152152
[MethodImpl(MethodImplOptions.AggressiveInlining)]
153153
publicstaticPBooloperator>=(inIPValuepValue1,inPStringpValue2)
154154
{
155-
returnpValue1isPStringpString&&string.Compare(pString.value,pValue2.value)!=-1;
155+
returnpValue1isPStringpString&&string.Compare(pString.value,pValue2.value)>=0;
156156
}
157157

158158
[MethodImpl(MethodImplOptions.AggressiveInlining)]
159159
publicstaticPBooloperator>=(inPStringpValue1,inIPValuepValue2)
160160
{
161-
returnpValue2isPStringpString&&string.Compare(pString.value,pValue1.value)!=-1;
161+
returnpValue2isPStringpString&&string.Compare(pString.value,pValue1.value)>=0;
162162
}
163163

164164
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -194,4 +194,4 @@ public object ToDict()
194194
returnToString();
195195
}
196196
}
197-
}
197+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp