Browse Source

Minor addition to HashMap

tags/2021-05-28
jules 12 years ago
parent
commit
f5175b3c2d
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      modules/juce_core/containers/juce_HashMap.h

+ 2
- 0
modules/juce_core/containers/juce_HashMap.h View File

@@ -42,6 +42,8 @@ class DefaultHashFunctions
public:
/** Generates a simple hash from an integer. */
static int generateHash (const int key, const int upperLimit) noexcept { return std::abs (key) % upperLimit; }
/** Generates a simple hash from an int64. */
static int generateHash (const int64 key, const int upperLimit) noexcept { return std::abs ((int) key) % upperLimit; }
/** Generates a simple hash from a string. */
static int generateHash (const String& key, const int upperLimit) noexcept { return (int) (((uint32) key.hashCode()) % (uint32) upperLimit); }
/** Generates a simple hash from a variant. */


Loading…
Cancel
Save