hash.cxx (87d2adbc) | hash.cxx (22076bf1) |
---|---|
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 --- 9 unchanged lines hidden (view full) --- 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_sal.hxx" | 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 --- 9 unchanged lines hidden (view full) --- 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_sal.hxx" |
26#include "rtl/allocator.hxx" | |
27 28#include "hash.h" 29#include "strimp.h" 30 | 26 27#include "hash.h" 28#include "strimp.h" 29 |
31 | |
32#include <hash_set> 33 34namespace { 35 36struct UStringHash 37{ 38 size_t operator()(rtl_uString * const &rString) const 39 { return (size_t)rtl_ustr_hashCode_WithLength( rString->buffer, rString->length ); } --- 8 unchanged lines hidden (view full) --- 48 return true; 49 if (pStringA->length != pStringB->length) 50 return false; 51 return !rtl_ustr_compare_WithLength( pStringA->buffer, pStringA->length, 52 pStringB->buffer, pStringB->length); 53 } 54}; 55 | 30#include <hash_set> 31 32namespace { 33 34struct UStringHash 35{ 36 size_t operator()(rtl_uString * const &rString) const 37 { return (size_t)rtl_ustr_hashCode_WithLength( rString->buffer, rString->length ); } --- 8 unchanged lines hidden (view full) --- 46 return true; 47 if (pStringA->length != pStringB->length) 48 return false; 49 return !rtl_ustr_compare_WithLength( pStringA->buffer, pStringA->length, 50 pStringB->buffer, pStringB->length); 51 } 52}; 53 |
56typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual, 57 rtl::Allocator<rtl_uString *> > StringHashTable; | 54typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual > StringHashTable; |
58 59StringHashTable * 60getHashTable () 61{ 62 static StringHashTable *pInternPool = NULL; 63 if (pInternPool == NULL) { 64 static StringHashTable aImpl(1024); 65 pInternPool = &aImpl; --- 44 unchanged lines hidden --- | 55 56StringHashTable * 57getHashTable () 58{ 59 static StringHashTable *pInternPool = NULL; 60 if (pInternPool == NULL) { 61 static StringHashTable aImpl(1024); 62 pInternPool = &aImpl; --- 44 unchanged lines hidden --- |