Tidy up the use of DFAStateCallback arguments. No, really.
Change-Id: Ic9d4e6b16d2ce9b8139652781e70ea6fd96075ea
Reviewed-on: https://code-review.googlesource.com/14130
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/re2/dfa.cc b/re2/dfa.cc
index e1b897c..27fd049 100644
--- a/re2/dfa.cc
+++ b/re2/dfa.cc
@@ -1955,7 +1955,7 @@
}
// Build out all states in DFA for kind. Returns number of states.
-int Prog::BuildEntireDFA(MatchKind kind, DFAStateCallback cb) {
+int Prog::BuildEntireDFA(MatchKind kind, const DFAStateCallback& cb) {
return GetDFA(kind)->BuildAllStates(cb);
}
diff --git a/re2/prog.h b/re2/prog.h
index fa24341..3176898 100644
--- a/re2/prog.h
+++ b/re2/prog.h
@@ -272,7 +272,7 @@
// If cb is not empty, it receives one callback per state built.
// Returns the number of states built.
// FOR TESTING OR EXPERIMENTAL PURPOSES ONLY.
- int BuildEntireDFA(MatchKind kind, DFAStateCallback cb);
+ int BuildEntireDFA(MatchKind kind, const DFAStateCallback& cb);
// Controls whether the DFA should bail out early if the NFA would be faster.
// FOR TESTING ONLY.