@@ -251,26 +251,32 @@ TextLayoutCacheKey::TextLayoutCacheKey(const TextLayoutCacheKey& other) :
251251 }
252252}
253253
254- bool TextLayoutCacheKey::operator <(const TextLayoutCacheKey& rhs) const {
255- LTE_INT (count) {
256- LTE_INT (typeface) {
257- LTE_FLOAT (textSize) {
258- LTE_FLOAT (textSkewX) {
259- LTE_FLOAT (textScaleX) {
260- LTE_INT (flags) {
261- LTE_INT (hinting) {
262- LTE_INT (dirFlags) {
263- return memcmp (getText (), rhs.getText (),
264- count * sizeof (UChar)) < 0 ;
265- }
266- }
267- }
268- }
269- }
270- }
271- }
272- }
273- return false ;
254+ int TextLayoutCacheKey::compare (const TextLayoutCacheKey& lhs, const TextLayoutCacheKey& rhs) {
255+ int deltaInt = lhs.count - rhs.count ;
256+ if (deltaInt != 0 ) return (deltaInt);
257+
258+ if (lhs.typeface < rhs.typeface ) return -1 ;
259+ if (lhs.typeface > rhs.typeface ) return +1 ;
260+
261+ if (lhs.textSize < rhs.textSize ) return -1 ;
262+ if (lhs.textSize > rhs.textSize ) return +1 ;
263+
264+ if (lhs.textSkewX < rhs.textSkewX ) return -1 ;
265+ if (lhs.textSkewX > rhs.textSkewX ) return +1 ;
266+
267+ if (lhs.textScaleX < rhs.textScaleX ) return -1 ;
268+ if (lhs.textScaleX > rhs.textScaleX ) return +1 ;
269+
270+ deltaInt = lhs.flags - rhs.flags ;
271+ if (deltaInt != 0 ) return (deltaInt);
272+
273+ deltaInt = lhs.hinting - rhs.hinting ;
274+ if (deltaInt != 0 ) return (deltaInt);
275+
276+ deltaInt = lhs.dirFlags - rhs.dirFlags ;
277+ if (deltaInt) return (deltaInt);
278+
279+ return memcmp (lhs.getText (), rhs.getText (), lhs.count * sizeof (UChar));
274280}
275281
276282void TextLayoutCacheKey::internalTextCopy () {
0 commit comments