Simplify rewrite in SpanClassQuery
Change-Id: Ief7605839bfae4187ee22cab8aac311ce9e646bb
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanClassQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanClassQuery.java
index 0b2df96..946d75d 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanClassQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanClassQuery.java
@@ -51,25 +51,20 @@
termContexts, number);
};
-
@Override
public Query rewrite (IndexReader reader) throws IOException {
- SpanClassQuery clone = null;
+
SpanQuery query = (SpanQuery) this.firstClause.rewrite(reader);
if (query != this.firstClause) {
- if (clone == null)
- clone = this.clone();
+
+ SpanClassQuery clone = this.clone();
clone.firstClause = query;
+ return clone;
};
-
- if (clone != null)
- return clone;
-
return this;
};
-
@Override
public SpanClassQuery clone () {
SpanClassQuery spanClassQuery = new SpanClassQuery(