Skip to content

Commit

Permalink
Small optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
ollandos committed May 25, 2016
1 parent 774d5a7 commit 63b1379
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions openformats/formats/stringsdict.py
Expand Up @@ -372,7 +372,7 @@ def _compile_plural_string(self, placeholder_key, placeholder_value):
key=lambda x: x[0]
)
compiled_string_list = []
for rule, string in sotrted_string_list[:-1]:
for rule, string in sotrted_string_list:
compiled_string_list.extend([
self.KEY_TEMPLATE.format(
rule_string=self.get_rule_string(rule)
Expand All @@ -383,17 +383,7 @@ def _compile_plural_string(self, placeholder_key, placeholder_value):
),
placeholder_key.tail
])

rule, string = sotrted_string_list[-1]
compiled_string_list.extend([
self.KEY_TEMPLATE.format(
rule_string=self.get_rule_string(rule)
),
placeholder_key.tail,
self.STRING_TEMPLATE.format(
plural_string=string
)
])
compiled_string_list = compiled_string_list[:-1]
self.transcriber.add(u''.join(compiled_string_list))
self.next_string = self._get_next_string()

Expand Down

0 comments on commit 63b1379

Please sign in to comment.