@@ -180,7 +180,7 @@ public void ClearCommentsFromLines()
180180 {
181181 for ( int i = 0 ; i < CleanedLines . Length ; i ++ )
182182 {
183- if ( CleanedLines [ i ] . StartsWith ( "#" ) )
183+ if ( CleanedLines [ i ] . StartsWith ( '#' ) )
184184 {
185185 if ( Lines [ i ] . StartsWith ( "##" ) && CleanedLines [ i ] . StartsWith ( "##ignorewarning " ) )
186186 {
@@ -199,11 +199,11 @@ public void ClearCommentsFromLines()
199199 {
200200 BlankLines ++ ;
201201 }
202- else if ( CleanedLines [ i ] . StartsWith ( "-" ) )
202+ else if ( CleanedLines [ i ] . StartsWith ( '-' ) )
203203 {
204204 CodeLines ++ ;
205205 }
206- else if ( CleanedLines [ i ] . EndsWith ( ":" ) )
206+ else if ( CleanedLines [ i ] . EndsWith ( ':' ) )
207207 {
208208 StructureLines ++ ;
209209 }
@@ -277,7 +277,7 @@ public void LoadInjects()
277277 {
278278 for ( int x = i ; x >= 0 ; x -- )
279279 {
280- if ( CleanedLines [ x ] . Length > 0 && CleanedLines [ x ] . EndsWith ( ":" ) && ! Lines [ x ] . Replace ( "\t " , " " ) . StartsWith ( " " ) )
280+ if ( CleanedLines [ x ] . Length > 0 && CleanedLines [ x ] . EndsWith ( ':' ) && ! Lines [ x ] . Replace ( "\t " , " " ) . StartsWith ( ' ' ) )
281281 {
282282 string scriptName = CleanedLines [ x ] [ 0 ..^ 1 ] ;
283283 Injects . Add ( scriptName ) ;
@@ -305,7 +305,7 @@ public void BasicLineFormatCheck()
305305 for ( int i = 0 ; i < Lines . Length ; i ++ )
306306 {
307307 string line = Lines [ i ] ;
308- if ( line . EndsWith ( " " ) )
308+ if ( line . EndsWith ( ' ' ) )
309309 {
310310 int endChar ;
311311 for ( endChar = line . Length - 1 ; endChar >= 0 ; endChar -- )
@@ -318,7 +318,7 @@ public void BasicLineFormatCheck()
318318 endChar = Math . Max ( 0 , endChar ) ;
319319 Warn ( MinorWarnings , i , "stray_space_eol" , "Stray space after end of line (possible copy/paste mixup. Enable View->Render Whitespace in VS Code)." , endChar , Math . Max ( endChar , line . Length - 1 ) ) ;
320320 }
321- else if ( CleanedLines [ i ] . StartsWith ( "- " ) && ! CleanedLines [ i ] . EndsWith ( ":" ) )
321+ else if ( CleanedLines [ i ] . StartsWith ( "- " ) && ! CleanedLines [ i ] . EndsWith ( ':' ) )
322322 {
323323 int spaces = CountPreSpaces ( line ) ;
324324 while ( i + 1 < Lines . Length )
@@ -379,7 +379,7 @@ public void CheckForBraces()
379379 }
380380 for ( int i = 0 ; i < Lines . Length ; i ++ )
381381 {
382- if ( Lines [ i ] . EndsWith ( "{" ) || Lines [ i ] . EndsWith ( "}" ) )
382+ if ( Lines [ i ] . EndsWith ( '{' ) || Lines [ i ] . EndsWith ( '}' ) )
383383 {
384384 int start = Lines [ i ] . IndexOfAny ( BracesChars ) ;
385385 int end = Lines [ i ] . LastIndexOfAny ( BracesChars ) ;
@@ -732,7 +732,7 @@ public static CommandArgument[] BuildArgs(int line, int startChar, string string
732732 hasSpace = true ;
733733 }
734734 }
735- if ( ! ( hasSpace || ( tagMarks != 0 && matched . Contains ( ' ' ) ) ) && ! matched . EndsWith ( ":" ) )
735+ if ( ! ( hasSpace || ( tagMarks != 0 && matched . Contains ( ' ' ) ) ) && ! matched . EndsWith ( ':' ) )
736736 {
737737 checker . Warn ( checker . MinorWarnings , line , "bad_quotes" , "Pointless quotes (arguments quoted but do not contain spaces)." , startChar + start , startChar + i ) ;
738738 }
@@ -793,7 +793,7 @@ public void CheckSingleCommand(int line, int startChar, string commandText, Scri
793793 string [ ] parts = commandText . Split ( ' ' , 2 ) ;
794794 string commandName = parts [ 0 ] . ToLowerFast ( ) ;
795795 int cmdLen = commandName . Length ;
796- if ( commandName . StartsWith ( "~" ) || commandName . StartsWith ( "^" ) )
796+ if ( commandName . StartsWith ( '~' ) || commandName . StartsWith ( '^' ) )
797797 {
798798 commandName = commandName [ 1 ..] ;
799799 }
@@ -973,14 +973,14 @@ void checkAsScript(List<object> list, ScriptCheckContext context = null)
973973 if ( typeString . Text == "task" )
974974 {
975975 // Workaround the weird way shoot command does things
976- context . Definitions . UnionWith ( new [ ] { "shot_entities" , "last_entity" , "location" , "hit_entities" } ) ;
976+ context . Definitions . UnionWith ( [ "shot_entities" , "last_entity" , "location" , "hit_entities" ] ) ;
977977 }
978978 else if ( typeString . Text == "economy" )
979979 {
980- context . Definitions . UnionWith ( new [ ] { "amount" } ) ;
980+ context . Definitions . UnionWith ( [ "amount" ] ) ;
981981 }
982982 // Default run command definitions get used sometimes
983- context . Definitions . UnionWith ( new [ ] { "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "10" } ) ;
983+ context . Definitions . UnionWith ( [ "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "10" ] ) ;
984984 if ( Injects . Contains ( script . Name ) || Injects . Contains ( "*" ) )
985985 {
986986 context . HasUnknowableDefinitions = true ;
@@ -1492,7 +1492,7 @@ public Dictionary<LineTrackedString, object> GatherActualContainers()
14921492 continue ;
14931493 }
14941494 string text = cleaned [ "- " . Length ..] ;
1495- if ( ! cleaned . EndsWith ( ":" ) )
1495+ if ( ! cleaned . EndsWith ( ':' ) )
14961496 {
14971497 while ( i + 1 < Lines . Length )
14981498 {
@@ -1549,7 +1549,7 @@ public Dictionary<LineTrackedString, object> GatherActualContainers()
15491549 string startofline ;
15501550 string endofline = "" ;
15511551 int endIndex = cleanStartCut ;
1552- if ( cleaned . EndsWith ( ":" ) )
1552+ if ( cleaned . EndsWith ( ':' ) )
15531553 {
15541554 startofline = cleaned [ 0 ..^ 1 ] ;
15551555 }
0 commit comments