Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1125)

Unified Diff: Source/core/html/parser/HTMLEntityTable.h

Issue 199103002: Better storage of HTML entities. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/parser/HTMLEntityTable.h
diff --git a/Source/core/html/parser/HTMLEntityTable.h b/Source/core/html/parser/HTMLEntityTable.h
index b5cd6c4869b2f738cfd94355e1e19e7f833bf3cc..1e465049b57148e25eb6ccfde7ade4bb44c18a91 100644
--- a/Source/core/html/parser/HTMLEntityTable.h
+++ b/Source/core/html/parser/HTMLEntityTable.h
@@ -30,13 +30,14 @@
namespace WebCore {
+// Member order to optimize packing. There will be thousands of these objects.
struct HTMLEntityTableEntry {
- LChar lastCharacter() const { return entity[length - 1]; }
+ LChar lastCharacter() const;
- const LChar* entity;
- int length;
UChar32 firstValue;
- UChar32 secondValue;
+ UChar secondValue; // UChar since double char sequences only use BMP chars.
+ short entityOffset;
+ short length;
};
class HTMLEntityTable {
@@ -46,6 +47,8 @@ public:
static const HTMLEntityTableEntry* firstEntryStartingWith(UChar);
static const HTMLEntityTableEntry* lastEntryStartingWith(UChar);
+
+ static const LChar* entityString(const HTMLEntityTableEntry&);
};
}

Powered by Google App Engine
This is Rietveld 408576698