On 11/07/2015 04:01, Marvin Humphrey wrote:
Wow.  I thought we had disagreed about this in the past, so I was prepping
for some constructive debate. ;)  But now, not only have we reached agreement
on all important issues, you've coded the whole thing up!

Yeah, at some point I was concerned about removing Int32. Back then, I didn't fully understand the purpose of the Num classes. I thought removing Int32 would force users to always use 64-bit integers, but this isn't the case.

I also checked the conversion code in Lucy's SortFieldWriter, here:

https://github.com/nwellnhof/lucy/commit/8144f5c7f3806873b58a9f1e751243f2c294eb13#diff-6c25c769e6f97d81aa1663f8781965c2L276

The lossy cast is a decent approach.  It would also have been reasonable to
throw an exception on overflow, but the chances of truncation-on-overflow
causing a serious problem seem remote.

I think SortFieldWriter will never see an out-of-bounds integer in an INT32 field. But maybe we should add a range check to Inverter.

Nick

Reply via email to