Commit 455615e8 authored by Mathieu Bridon's avatar Mathieu Bridon

Simplify some code

We now that  is not None here, because we set it to
something just before if it was.

So let's drop one indentation level.
parent 795f6e7a
......@@ -310,12 +310,11 @@ class Engine(IBus.Engine):
if not code:
code = self.current_input
if code:
for c in sorted(self.cangjie.getCharacters(code),
key=attrgetter("frequency"),
reverse=True):
self.lookuptable.append_candidate(IBus.Text.new_from_string(c.chchar))
num_candidates += 1
for c in sorted(self.cangjie.getCharacters(code),
key=attrgetter("frequency"),
reverse=True):
self.lookuptable.append_candidate(IBus.Text.new_from_string(c.chchar))
num_candidates += 1
if num_candidates == 0:
self.play_error_bell()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment