diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-23 11:41:35 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-23 13:35:59 (GMT) |
commit | afb4eee57f22461c329aac534c8d0468c234acfd (patch) | |
tree | 76765d598dc99d84dc6200cca0df70c3c917a659 /doc/src/snippets/code/src_gui_util_qundostack.cpp | |
parent | 2c18a5665f70cd7ff62bfffac2c3f2b5364d7392 (diff) | |
download | Qt-afb4eee57f22461c329aac534c8d0468c234acfd.zip Qt-afb4eee57f22461c329aac534c8d0468c234acfd.tar.gz Qt-afb4eee57f22461c329aac534c8d0468c234acfd.tar.bz2 |
Optimize QMetaObject::indexOf* functions
Comparing the first character before calling strcmp gives big
speedup, as it avoid the overhead of calling the strcmp function
in many cases.
In indexOfMethodRelative, fix the normalize case. The computation
of the normalized string was put outside of the for loop, but it should
have been inside. This was not detected by the test because the wrong
string is at the end.
In IndexOfMethodRelative, we do not need to check if the method is a signal
or a slot, because we only iterate over the right interval.
This is only true for code generated by moc since Qt 4.6.
Which means that in application compiled with Qt 4.5 and older,
indexOfSignal could now return a slot with the same name (and vice-versa),
but I this it is safe to ignore that "problem".
Reviewed-by: Roberto Raggi
Reviewed-by: Kent Hansen
Diffstat (limited to 'doc/src/snippets/code/src_gui_util_qundostack.cpp')
0 files changed, 0 insertions, 0 deletions