File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
CefSharp.Extensions/ModelBinding Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -456,14 +456,19 @@ private static string ConvertNameToCamelCase(this string sourceString)
456456
457457 // camelCase says that if the string is only one character that it is preserved.
458458 if ( sourceString . Length == 1 )
459+ {
459460 return sourceString ;
460-
461- var firstHalf = sourceString . Substring ( 0 , 1 ) ;
462- var remainingHalf = sourceString . Substring ( 1 ) ;
461+ }
463462
464463 // camelCase says that if the entire string is uppercase to preserve it.
465- if ( char . IsUpper ( firstHalf [ 0 ] ) && char . IsUpper ( remainingHalf [ 0 ] ) )
464+ //TODO: We need to cache these values to avoid the cost of validating this
465+ if ( sourceString . All ( char . IsUpper ) )
466+ {
466467 return sourceString ;
468+ }
469+
470+ var firstHalf = sourceString . Substring ( 0 , 1 ) ;
471+ var remainingHalf = sourceString . Substring ( 1 ) ;
467472
468473 return firstHalf . ToLowerInvariant ( ) + remainingHalf ;
469474 }
You can’t perform that action at this time.
0 commit comments