File tree Expand file tree Collapse file tree 1 file changed +0
-30
lines changed
third-party/folly/src/folly Expand file tree Collapse file tree 1 file changed +0
-30
lines changed Original file line number Diff line number Diff line change @@ -793,36 +793,6 @@ class Range {
793793 return b_[i];
794794 }
795795
796- // Do NOT use this function, which was left behind for backwards
797- // compatibility. Use SpookyHashV2 instead -- it is faster, and produces
798- // a 64-bit hash, which means dramatically fewer collisions in large maps.
799- // (The above advice does not apply if you are targeting a 32-bit system.)
800- //
801- // Works only for Range<const char*> and Range<char*>
802- //
803- //
804- // ** WANT TO GET RID OF THIS LINT? **
805- //
806- // A) Use a better hash function (*cough*folly::Hash*cough*), but
807- // only if you don't serialize data in a format that depends on
808- // this formula (ie the writer and reader assume this exact hash
809- // function is used).
810- //
811- // B) If you have to use this exact function then make your own hasher
812- // object and copy the body over (see thrift example: D3972362).
813- // https://github.com/facebook/fbthrift/commit/f8ed502e24ab4a32a9d5f266580
814- [[deprecated(
815- " Replace with folly::Hash if the hash is not serialized" )]] uint32_t
816- hash () const {
817- // Taken from fbi/nstring.h:
818- // Quick and dirty bernstein hash...fine for short ascii strings
819- uint32_t hash = 5381 ;
820- for (size_t ix = 0 ; ix < size (); ix++) {
821- hash = ((hash << 5 ) + hash) + b_[ix];
822- }
823- return hash;
824- }
825-
826796 void advance (size_type n) {
827797 if (FOLLY_UNLIKELY (n > size ())) {
828798 throw_exception<std::out_of_range>(" index out of range" );
You can’t perform that action at this time.
0 commit comments