Codechange: Use std::map instead of custom SmallMap.
This commit is contained in:
@@ -167,14 +167,14 @@ const Sprite *TrueTypeFontCache::GetGlyph(GlyphID key)
|
||||
|
||||
const void *TrueTypeFontCache::GetFontTable(uint32 tag, size_t &length)
|
||||
{
|
||||
const FontTable::iterator iter = this->font_tables.Find(tag);
|
||||
if (iter != this->font_tables.data() + this->font_tables.size()) {
|
||||
const auto iter = this->font_tables.find(tag);
|
||||
if (iter != this->font_tables.end()) {
|
||||
length = iter->second.first;
|
||||
return iter->second.second;
|
||||
}
|
||||
|
||||
const void *result = this->InternalGetFontTable(tag, length);
|
||||
|
||||
this->font_tables.Insert(tag, std::pair<size_t, const void *>(length, result));
|
||||
this->font_tables[tag] = std::pair<size_t, const void *>(length, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#ifndef TRUETYPEFONTCACHE_H
|
||||
#define TRUETYPEFONTCACHE_H
|
||||
|
||||
#include "../core/smallmap_type.hpp"
|
||||
#include "../fontcache.h"
|
||||
|
||||
|
||||
@@ -28,7 +27,7 @@ protected:
|
||||
int req_size; ///< Requested font size.
|
||||
int used_size; ///< Used font size.
|
||||
|
||||
typedef SmallMap<uint32, std::pair<size_t, const void *> > FontTable; ///< Table with font table cache
|
||||
using FontTable = std::map<uint32_t, std::pair<size_t, const void *>>; ///< Table with font table cache
|
||||
FontTable font_tables; ///< Cached font tables.
|
||||
|
||||
/** Container for information about a glyph. */
|
||||
|
||||
Reference in New Issue
Block a user