aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/SplitVector.h
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2013-04-19 16:27:21 +1000
committernyamatongwe <devnull@localhost>2013-04-19 16:27:21 +1000
commit8f19a8e14d8ddda4dab8a70e9c868e65aea199b0 (patch)
treef563fbd11be43c093d5e4a227351253604532e47 /src/SplitVector.h
parenta3642505f168f87738eda54a9514b38cb8f45fe9 (diff)
downloadscintilla-mirror-8f19a8e14d8ddda4dab8a70e9c868e65aea199b0.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.h3
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;