string.hxx (86e1cf34) | string.hxx (9246b6a2) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 931 unchanged lines hidden (view full) --- 940}; 941 942/* ======================================================================= */ 943 944/** Equality functor for classic c-strings (i.e. null-terminated char* strings) */ 945struct CStringEqual 946{ 947 bool operator()( const char* p1, const char* p2) const { | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 931 unchanged lines hidden (view full) --- 940}; 941 942/* ======================================================================= */ 943 944/** Equality functor for classic c-strings (i.e. null-terminated char* strings) */ 945struct CStringEqual 946{ 947 bool operator()( const char* p1, const char* p2) const { |
948 while( *p1) | 948 while( *p1 != '\0') |
949 if( *(p1++) != *(p2++)) 950 return false; | 949 if( *(p1++) != *(p2++)) 950 return false; |
951 return true; | 951 return (*p2 == '\0'); |
952 } 953}; 954 955/** Hashing functor for classic c-strings (i.e. null-terminated char* strings) */ 956struct CStringHash 957{ 958 size_t operator()( const char* p) const { 959 size_t n = 0; --- 18 unchanged lines hidden --- | 952 } 953}; 954 955/** Hashing functor for classic c-strings (i.e. null-terminated char* strings) */ 956struct CStringHash 957{ 958 size_t operator()( const char* p) const { 959 size_t n = 0; --- 18 unchanged lines hidden --- |