Commit 37d93aa
Fix Issue #1089: Don't optimize Option Compare Text empty string checks to string.IsNullOrEmpty()
Under Option Compare Text, Visual Basic evaluates certain invisible character strings as equal to `""`. Optimizing this down to `string.IsNullOrEmpty` in C# breaks correct behavior because C# considers these strings non-empty. This commit skips the null/empty optimization when `OptionCompareTextCaseInsensitive` is true, causing it to fall back to `CultureInfo.CurrentCulture.CompareInfo.Compare` logic.
Co-authored-by: GrahamTheCoder <2490482+GrahamTheCoder@users.noreply.github.com>1 parent 2c2b64e commit 37d93aa
File tree
2 files changed
+8
-2
lines changed- CodeConverter/CSharp
- Tests/CSharp/ExpressionTests
2 files changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
182 | 188 | | |
183 | 189 | | |
184 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| |||
0 commit comments