forked from OSchip/llvm-project
[gn build] sync script: try to make sync script even clearer
Turns out startswith() takes an optional start parameter :) No behavior change.
This commit is contained in:
parent
d7fec38f05
commit
cacb1a9f93
|
@ -29,7 +29,7 @@ def patch_gn_file(gn_file, add, remove):
|
|||
if add:
|
||||
srcs_tok = 'sources = ['
|
||||
tokloc = gn_contents.find(srcs_tok)
|
||||
while gn_contents[tokloc:].startswith('sources = []'):
|
||||
while gn_contents.startswith('sources = []', tokloc):
|
||||
tokloc = gn_contents.find(srcs_tok, tokloc + 1)
|
||||
if tokloc == -1: raise ValueError(gn_file + ': No source list')
|
||||
if gn_contents.find(srcs_tok, tokloc + 1) != -1:
|
||||
|
|
Loading…
Reference in New Issue