OSDN Git Service
(root)
/
kde
/
Katie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aed2139
)
minor QGraphicsItemPrivate::setExtra() optimization
author
Ivailo Monev
<xakepa10@gmail.com>
Fri, 5 Feb 2021 06:27:56 +0000
(08:27 +0200)
committer
Ivailo Monev
<xakepa10@gmail.com>
Fri, 5 Feb 2021 06:27:56 +0000
(08:27 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/graphicsview/qgraphicsitem_p.h
patch
|
blob
|
history
diff --git
a/src/gui/graphicsview/qgraphicsitem_p.h
b/src/gui/graphicsview/qgraphicsitem_p.h
index
6b1548c
..
218667c
100644
(file)
--- a/
src/gui/graphicsview/qgraphicsitem_p.h
+++ b/
src/gui/graphicsview/qgraphicsitem_p.h
@@
-321,19
+321,14
@@
public:
inline void setExtra(Extra type, const QVariant &value)
{
- int index = -1;
for (int i = 0; i < extras.size(); ++i) {
if (extras.at(i).type == type) {
-
index = i
;
-
break
;
+
extras[i].value = value
;
+
return
;
}
}
- if (index == -1) {
- extras << ExtraStruct(type, value);
- } else {
- extras[index].value = value;
- }
+ extras << ExtraStruct(type, value);
}
inline void unsetExtra(Extra type)