Skip to content

Commit

Permalink
No need to keep around an extra local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
tilgovi committed May 18, 2015
1 parent 189d300 commit 7f418ed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions annotator/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ def search_raw(cls, query=None, params=None, raw_result=False,
def _build_query(cls, query=None, offset=None, limit=None, sort=None, order=None):
if query is None:
query = {}
else:
query = dict(query) # shallow copy

# Pop 'before' and 'after' parameters out of the query
copied_query = dict(query)
after = copied_query.pop('after', None)
before = copied_query.pop('before', None)
after = query.pop('after', None)
before = query.pop('before', None)

q = super(Annotation, cls)._build_query(copied_query, offset, limit, sort, order)
q = super(Annotation, cls)._build_query(query, offset, limit, sort, order)

# Create range query from before and/or after
if before is not None or after is not None:
Expand Down

0 comments on commit 7f418ed

Please sign in to comment.