BIND 10 #463: "glue OK" mode for (Memory)Zone::find()

BIND 10 Development do-not-reply at isc.org
Thu Dec 30 19:12:38 UTC 2010


#463: "glue OK" mode for (Memory)Zone::find()
------------------------------+---------------------------------------------
      Reporter:  jinmei       |        Owner:  vorner               
          Type:  task         |       Status:  reviewing            
      Priority:  major        |    Milestone:  y2 12 month milestone
     Component:  data source  |   Resolution:                       
      Keywords:               |    Sensitive:  0                    
Estimatedhours:  0.0          |        Hours:  0                    
      Billable:  1            |   Totalhours:  0                    
      Internal:  0            |  
------------------------------+---------------------------------------------
Changes (by jinmei):

  * owner:  jinmei => vorner


Comment:

 Replying to [comment:4 vorner]:
 > Just one thing:
 >
 > {{{
 > return ((state->options_ & FIND_GLUE_OK) != 0 ? false : true)
 > }}}
 >
 > This seems unnecesarilly complicated. Wouldn't return(!(state->options_
 & FIND_GLUE_OK)); be better? The only thing that the condition does is
 negation.
 >
 > Otherwise it seems to be OK to merge.
 >
 I admit the current notaion doesn't look nice.  But I'm not very happy
 with '!(state->options_ & FIND_GLUEOK)' because it assumes implicit
 conversion from integer to bool.  This may be a pedantic concern in
 practice, but also follows BIND 9's coding guideline (some of which I
 adopt): http://bind10.isc.org/wiki/BIND9CodingGuidelines

 In any case the original code should have been simplified.  How about
 changing it as follows?
 {{{
             // Unless glue is allowed the search stops here, so we return
             // false; otherwise return true to continue the search.
             return ((state->options_ & FIND_GLUE_OK) == 0);
 }}}
 (I added some comments to clarify the intent)

-- 
Ticket URL: <http://bind10.isc.org/ticket/463#comment:5>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list