diff options
author | JustOff <Off.Just.Off@gmail.com> | 2019-03-13 20:04:13 +0200 |
---|---|---|
committer | JustOff <Off.Just.Off@gmail.com> | 2019-03-13 20:04:13 +0200 |
commit | b586a191ec085d2c6c5c4fdfb1b12102fb5de4c4 (patch) | |
tree | 8271d2b8f78dd3518f23fb93fc971489fe14e67b /dom/bindings/MozMap.h | |
parent | 5890367d30702ff8f2fbb6fc28e6ecdd6d5b2b84 (diff) | |
download | UXP-b586a191ec085d2c6c5c4fdfb1b12102fb5de4c4.tar UXP-b586a191ec085d2c6c5c4fdfb1b12102fb5de4c4.tar.gz UXP-b586a191ec085d2c6c5c4fdfb1b12102fb5de4c4.tar.lz UXP-b586a191ec085d2c6c5c4fdfb1b12102fb5de4c4.tar.xz UXP-b586a191ec085d2c6c5c4fdfb1b12102fb5de4c4.zip |
Rename the MozMap C++ type to "record" and give it a template parameter for the key type
Diffstat (limited to 'dom/bindings/MozMap.h')
-rw-r--r-- | dom/bindings/MozMap.h | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/dom/bindings/MozMap.h b/dom/bindings/MozMap.h index 2725c74ff..2fe18be2b 100644 --- a/dom/bindings/MozMap.h +++ b/dom/bindings/MozMap.h @@ -5,11 +5,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** - * Class for representing MozMap arguments. Basically an array under the hood. + * Class for representing record arguments. Basically an array under the hood. */ -#ifndef mozilla_dom_MozMap_h -#define mozilla_dom_MozMap_h +#ifndef mozilla_dom_Record_h +#define mozilla_dom_Record_h #include "nsTHashtable.h" #include "nsHashKeys.h" @@ -23,15 +23,15 @@ namespace dom { namespace binding_detail { template<typename KeyType, typename ValueType> -class MozMapEntry +class RecordEntry { public: - MozMapEntry() + RecordEntry() { } - // Move constructor so we can do MozMaps of MozMaps. - MozMapEntry(MozMapEntry<KeyType, ValueType>&& aOther) + // Move constructor so we can do Records of Records. + RecordEntry(RecordEntry<KeyType, ValueType>&& aOther) : mKey(Move(aOther.mKey)), mValue(Move(aOther.mValue)) { @@ -43,20 +43,19 @@ public: } // namespace binding_detail -template<typename ValueType> -class MozMap +template<typename KeyType, typename ValueType> +class Record { public: - typedef nsString KeyType; - typedef typename binding_detail::MozMapEntry<KeyType, ValueType> EntryType; - typedef MozMap<ValueType> SelfType; + typedef typename binding_detail::RecordEntry<nsString, ValueType> EntryType; + typedef Record<KeyType, ValueType> SelfType; - MozMap() + Record() { } - // Move constructor so we can do MozMap of MozMap. - MozMap(SelfType&& aOther) : + // Move constructor so we can do Record of Record. + Record(SelfType&& aOther) : mEntries(Move(aOther.mEntries)) { } @@ -78,4 +77,4 @@ private: } // namespace dom } // namespace mozilla -#endif // mozilla_dom_MozMap_h +#endif // mozilla_dom_Record_h |