Drop OP_SCALE_WEIGHT over OP_VALUE_* in Query ctor
commit63b504cca50f820de5a43677ad6ba5b0969f1992
authorOlly Betts <olly@survex.com>
Wed, 25 Jan 2017 03:09:40 +0000 (25 16:09 +1300)
committerOlly Betts <olly@survex.com>
Wed, 25 Jan 2017 03:09:40 +0000 (25 16:09 +1300)
treeb2382725aa4a38f8c51edcf1da339de1776f4409
parent78901705d2c46631a70a0e7ddc0e8da0f89bcb80
Drop OP_SCALE_WEIGHT over OP_VALUE_* in Query ctor

OP_VALUE_RANGE, OP_VALUE_GE and OP_VALUE_LE always return weight 0
so OP_SCALE_WEIGHT over them has no effect.  Eliminating it at
query construction time is cheap (just need to check the subquery's
type), eliminates the confusing "0 * " from the query description,
and means the OP_SCALE_WEIGHT object can be released sooner.

Inspired by Shivanshu Chauhan asking about the query description on
IRC.
xapian-bindings/lua/smoketest.lua
xapian-bindings/perl/t/parser.t
xapian-bindings/php/smoketest.php
xapian-bindings/php7/smoketest.php
xapian-bindings/python/pythontest.py
xapian-bindings/python/smoketest.py
xapian-bindings/python3/pythontest.py
xapian-bindings/python3/smoketest.py
xapian-core/api/query.cc
xapian-core/tests/api_queryparser.cc