+2007-10-28 Maciej Stachowiak <mjs@apple.com>
+
+ Rubber stamped by Mark.
+
+ - avoid using non-portable SIZE_T_MAX in favor of std::numeric_limits
+
+ * kjs/SymbolTable.h:
+ (KJS::SymbolTableIndexHashTraits::emptyValue):
+ * kjs/function.cpp:
+ (KJS::ActivationImp::getOwnPropertySlot):
+ (KJS::ActivationImp::put):
+
2007-10-28 Maciej Stachowiak <mjs@apple.com>
Reviewed by Eric.
static const bool safeToCompareToEmptyOrDeleted = true;
};
+ static const size_t missingSymbolMarker = std::numeric_limits<size_t>::max();
+
struct SymbolTableIndexHashTraits {
typedef size_t TraitType;
typedef SymbolTableIndexHashTraits StorageTraits;
- static size_t emptyValue() { return SIZE_T_MAX; }
+ static size_t emptyValue() { return missingSymbolMarker; }
static const bool emptyValueIsZero = false;
static const bool needsDestruction = false;
static const bool needsRef = false;
ASSERT(!_prop.hasGetterSetterProperties());
// it's more efficient to just get and check for a special empty
- // value of SIZE_T_MAX than to do a separate contains check
+ // value than to do a separate contains check
size_t index = symbolTable->get(propertyName.ustring().rep());
- if (index != SIZE_T_MAX) {
+ if (index != missingSymbolMarker) {
slot.setValueSlot(this, &d->localStorage[index].value);
return true;
}
ASSERT(prototype() == jsNull());
// it's more efficient to just get and check for a special empty
- // value of SIZE_T_MAX than to do a separate contains check
+ // value than to do a separate contains check
size_t index = symbolTable->get(propertyName.ustring().rep());
- if (index != SIZE_T_MAX) {
+ if (index != missingSymbolMarker) {
LocalStorageEntry& entry = d->localStorage[index];
entry.value = value;
entry.attributes = attr;