[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:
Nico Weber 2020-12-01 14:35:21 -05:00
parent d7fec38f05
commit cacb1a9f93
1 changed files with 1 additions and 1 deletions

View File

@ -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: