Revision 26d4699...
Go back to digest for 24th November 2013Optimization in Utilities
Harsh Kumar committed changes in [kate] part/utils/katebookmarks.cpp:
[patch 1/2] Improvements in KateBookmarks::insertBookmarks()
1.) Earlier code added one line number to sortArray in each iteration &
then sorted sortArray in each iteration.
Now, all the line numbers containing bookmarks are first added in
bookmarkLineArray & then sorted. Thus, the sorting algorithm is called
only once rather than calling it everytime a line with bookmark is
encountered.
2.) After all the bookmark line numbers are in bookmarkLineArray, just
iterate on that array. So, no loop is required to find out the index of
line number under consideration in the sorted array.
Removes a 'for' loop entirely which earlier ran for each iteration of
outer loop.
3.) Added some comments
REVIEW: 113974
File Changes
Modified 1 files
- part/utils/katebookmarks.cpp
1 files changed in total