Bug 1566467 - Speed up shared/node-attribute-parser getType function. r=nchevobbe
commit6e997644fabbc685702c855c611a51a344f7d276
authorGabriel Luong <gabriel.luong@gmail.com>
Tue, 16 Jul 2019 15:19:59 +0000 (16 11:19 -0400)
committerGabriel Luong <gabriel.luong@gmail.com>
Tue, 16 Jul 2019 15:19:59 +0000 (16 11:19 -0400)
tree01d5a922a6eded64fca3a496f8f6bc5c7fc3a40f
parent1dd2923ea147d77ce2b66dfeb8751ed43b91889c
Bug 1566467 - Speed up shared/node-attribute-parser getType function. r=nchevobbe

We can speed up the getType function by changing the dataType into an object from an array.
That way we avoid looping looking for the matching tagName and namespaceURI and access the typeData directly by their tagName.

Differential Revision: https://phabricator.services.mozilla.com/D38196
devtools/client/shared/node-attribute-parser.js