diff options
author | nyamatongwe <unknown> | 2013-04-19 16:27:21 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2013-04-19 16:27:21 +1000 |
commit | c17ecd0761377ba11067ccfdd917c01aa8e7ed7c (patch) | |
tree | 448f2823f33a10d6a23cd6fe1da1622469f65576 /src/SplitVector.h | |
parent | 92d4c0e3222dda625e991d17cda4af1181d6c6e3 (diff) | |
download | scintilla-mirror-c17ecd0761377ba11067ccfdd917c01aa8e7ed7c.tar.gz |
Using std::fill instead of a loop is much faster. As much as 4x on a large block.
Diffstat (limited to 'src/SplitVector.h')
-rw-r--r-- | src/SplitVector.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/SplitVector.h b/src/SplitVector.h index 0ccf6c9f4..502101b6c 100644 --- a/src/SplitVector.h +++ b/src/SplitVector.h @@ -174,8 +174,7 @@ public: } RoomFor(insertLength); GapTo(position); - for (int i = 0; i < insertLength; i++) - body[part1Length + i] = v; + std::fill(&body[part1Length], &body[part1Length + insertLength], v); lengthBody += insertLength; part1Length += insertLength; gapLength -= insertLength; |