File tree 1 file changed +7
-7
lines changed 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -990,16 +990,16 @@ class EnforceStringStyle : public Pass {
990
990
if (c == ' \' ' ) num_single++;
991
991
if (c == ' "' ) num_double++;
992
992
}
993
- if (num_single > 0 && num_double > 0 ) return ;
994
- char style = opts.stringStyle == ' s' ;
993
+ if (num_single > 0 && num_double > 0 ) return ; // Don't change it.
994
+ bool use_single = opts.stringStyle == ' s' ;
995
995
if (num_single > 0 )
996
- style = ' d ' ;
996
+ use_single = false ;
997
997
if (num_double > 0 )
998
- style = ' s ' ;
998
+ use_single = true ;
999
999
1000
- // Change it
1001
- lit->value = jsonnet_string_escape (canonical, style == ' s ' );
1002
- lit->tokenKind = style ? LiteralString::SINGLE : LiteralString::DOUBLE;
1000
+ // Change it.
1001
+ lit->value = jsonnet_string_escape (canonical, use_single );
1002
+ lit->tokenKind = use_single ? LiteralString::SINGLE : LiteralString::DOUBLE;
1003
1003
}
1004
1004
};
1005
1005
You can’t perform that action at this time.
0 commit comments