From 99bee51302576fad5969a85a0fa43e02c50a2e13 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Mon, 9 May 2016 23:05:10 +0200 Subject: [PATCH] Micro-optimization (just for fun) --- patacrep/songs/chordpro/syntax.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patacrep/songs/chordpro/syntax.py b/patacrep/songs/chordpro/syntax.py index c4dea4cc..a1e3f6e6 100644 --- a/patacrep/songs/chordpro/syntax.py +++ b/patacrep/songs/chordpro/syntax.py @@ -157,7 +157,7 @@ class ChordproParser(Parser): def _iter_image_size_arguments(self, argument, *, lineno): arguments = set() - length_names = set(["width", "height"]) + length_names = frozenset(["width", "height"]) for name, value, unit in self._iter_raw_image_size_arguments(argument, lineno=lineno): if name in arguments: self.error( @@ -166,7 +166,7 @@ class ChordproParser(Parser): ) continue if ( - name == "scale" and arguments.intersection(length_names) + name == "scale" and not length_names.isdisjoint(arguments) ) or ( name in length_names and "scale" in arguments ):