Branch: Tag:

2014-04-25

2014-04-25 13:54:31 by Martin Nilsson <nilsson@opera.com>

Identifiers can not properly be sorted and stored in multisets.

581:    }   #endif    -  int __hash() +  protected int __hash()    {    return hash(get_der());    }    -  int `==(mixed other) { +  protected int(0..1) `==(mixed other) {    return (objectp(other) &&    (this_program == object_program(other)) &&    equal(id, ([object(Identifier)]other)->id));    } -  +  +  protected int(0..1) `<(mixed other) { +  if( !objectp(other) || +  (this_program != object_program(other)) ) +  return 0; +  array oid = ([object(Identifier)]other)->id; +  for( int i; i<min(sizeof(id),sizeof(oid)); i++ ) +  { +  if( id[i] < oid[i] ) return 1; +  if( id[i] > oid[i] ) return 0;    } -  +  return sizeof(id) < sizeof(oid); +  } + }      //! Checks if a Pike string can be encoded with UTF8. That is   //! always the case...