summaryrefslogtreecommitdiffstats
path: root/src/extras/defaults/qdiffusespecularmaterial.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-05-17 13:05:26 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-07-22 10:54:51 +0300
commit9b91d68df0a812b2fa0dd3da3f06ff0724033a46 (patch)
treebf09cf336aaf367830976cabaea19ce53aea7364 /src/extras/defaults/qdiffusespecularmaterial.cpp
parent7c5f56277cd0c7450a168af6188ee4753655ca31 (diff)
assimp plugin: replace QMap with a C array
The keys are statically known, short, and few, so replace the QMap<QByteArray, OpenMode> with a C array of a {char[2]; OpenMode} struct, which occupies just 40B in read-only memory. We don't even need to sort the list, as binary search in a list of ten entries is slower than linear search (five comparisons each, on average, with the linear scan having a predictable memory access pattern. This is a port of dd1d8f51e67ec93031fdd7f7930d63761d1238e6 to the other copy of this code, which shows that arguments like 'this is just a tool, not a library' are ill-advised. Code _will_ be copied. Change-Id: Ie04137f94e487ce998ec077daf655b09bcbbcfc7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/extras/defaults/qdiffusespecularmaterial.cpp')
0 files changed, 0 insertions, 0 deletions