Re: [xml] "double"s and schema validation
- From: Dan Sommers <dan tombstonezero net>
- To: xml gnome org
- Subject: Re: [xml] "double"s and schema validation
- Date: Fri, 23 Jul 2010 12:36:20 +0000 (UTC)
On Fri, 23 Jul 2010 05:48:39 +0300, Andrew W. Nosenko wrote:
On Fri, Jul 23, 2010 at 03:34, Dan Sommers <dan tombstonezero net>
There's no need for two counters. ÂJust use the same counter inside
both loops and check for that counter being zero (or non-zero) at the
end (then again, a sufficiently clever optimizer may already be doing
that for you).
No, optimizer cannot to do that because they aren't equivalent. Just
imagine that one int (e.g. digits_before) obtained value 1 and another
overflowed to -1. This scenario will produce "true" in
digits_before+digits_after==0 check. Now imagine the only one counter.
On the same imaginable data it will be overflowed to -2 and check for
zero will return "false".
Duh. I knew that. ;-)
But anyway, I see no needs in counters at all. Just because what you
need is just an boolean flag (zero vs. not zero, there were any digits
or not) ...
By the way it far simpler for optimizer and may be handled better by it
indeed without unsafe tricks and assumptions.
Premature optimization and all that. Sorry.
So what's the next step? Does someone submit a bug report, or a bug
report with a suggested patch, or something else?
] [Thread Prev