BIND 10 #2377: define dns::MasterLoad class
BIND 10 Development
do-not-reply at isc.org
Mon Dec 10 17:51:13 UTC 2012
#2377: define dns::MasterLoad class
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: task | jinmei
Priority: medium | Status:
Component: libdns++ | reviewing
Keywords: | Milestone:
Sensitive: 0 | Sprint-20121218
Sub-Project: DNS | Resolution:
Estimated Difficulty: 7 | CVSS Scoring:
Total Hours: 0 | Defect Severity: N/A
| Feature Depending on Ticket:
| loadzone-ng
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Comment (by jinmei):
Replying to [comment:21 vorner]:
> [...] But I believe that
> concern is not only premature optimisation, but the overhead is actually
> negligible. It is not copying the string, it is only scanning the
characters once
> again in the buffer in source.
It does copy the string. For string-variant tokens, getNextToken()
always builds the string data in the data_ vector, once clearing it.
Besides, the readability argument doesn't seem to be fair, at least
not yet. As I said before, we also need to handle the `INITIAL_WS`
case. So we cannot simply do:
{{{#!cpp
const MasterToken::StringRegion&
name_string(lexer_.getNextToken(MasterToken::QSTRING).
getStringRegion());
}}}
but need some kind of if-else or switch-case anyway. I'm okay with
deferring the actual handling of it to a separate ticket, but if you
want to claim better readability, we need to discuss it with taking
into account the resulting form of code that handles deferred cases.
--
Ticket URL: <http://bind10.isc.org/ticket/2377#comment:22>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list