aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/RESearch.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-07-24 13:38:56 +1000
committerNeil <nyamatongwe@gmail.com>2014-07-24 13:38:56 +1000
commitb4ec5a5d10c547f238c335a89329a03f30b32b4b (patch)
treec47baa3f9c729a3c070f358c0ca9a2ba2a7fc747 /src/RESearch.cxx
parent7afb5fb389fe0c59e6952e1f5b6861105fab3bad (diff)
downloadscintilla-mirror-b4ec5a5d10c547f238c335a89329a03f30b32b4b.tar.gz
Ensure all fields initialised in constructor.
Diffstat (limited to 'src/RESearch.cxx')
-rw-r--r--src/RESearch.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/RESearch.cxx b/src/RESearch.cxx
index 74db01355..138469f0a 100644
--- a/src/RESearch.cxx
+++ b/src/RESearch.cxx
@@ -203,6 +203,7 @@
#include <stdlib.h>
#include <string>
+#include <algorithm>
#include "CharClassify.h"
#include "RESearch.h"
@@ -251,22 +252,18 @@ const char bitarr[] = { 1, 2, 4, 8, 16, 32, 64, '\200' };
RESearch::RESearch(CharClassify *charClassTable) {
failure = 0;
charClass = charClassTable;
- Init();
+ sta = NOP; /* status of lastpat */
+ bol = 0;
+ std::fill(bittab, bittab + BITBLK, 0);
+ std::fill(tagstk, tagstk + MAXTAG, 0);
+ std::fill(nfa, nfa + MAXNFA, 0);
+ Clear();
}
RESearch::~RESearch() {
Clear();
}
-void RESearch::Init() {
- sta = NOP; /* status of lastpat */
- bol = 0;
- for (int i = 0; i < MAXTAG; i++)
- pat[i].clear();
- for (int j = 0; j < BITBLK; j++)
- bittab[j] = 0;
-}
-
void RESearch::Clear() {
for (int i = 0; i < MAXTAG; i++) {
pat[i].clear();