Use reference instead of pointer
This commit is contained in:
parent
78a20b72a3
commit
cb177712f6
|
@ -269,7 +269,7 @@ std::string TokenStreamRewriter::getText(const std::string &programName, const I
|
|||
std::string buf;
|
||||
|
||||
// First, optimize instruction stream
|
||||
std::unordered_map<size_t, TokenStreamRewriter::RewriteOperation*> indexToOp = reduceToSingleOperationPerIndex(&rewrites);
|
||||
std::unordered_map<size_t, TokenStreamRewriter::RewriteOperation*> indexToOp = reduceToSingleOperationPerIndex(rewrites);
|
||||
|
||||
// Walk buffer, executing instructions and emitting tokens
|
||||
size_t i = start;
|
||||
|
@ -305,9 +305,8 @@ std::string TokenStreamRewriter::getText(const std::string &programName, const I
|
|||
}
|
||||
|
||||
std::unordered_map<size_t, TokenStreamRewriter::RewriteOperation*> TokenStreamRewriter::reduceToSingleOperationPerIndex(
|
||||
std::vector<TokenStreamRewriter::RewriteOperation*> *rewrites_ptr) {
|
||||
std::vector<TokenStreamRewriter::RewriteOperation*> &rewrites) {
|
||||
|
||||
std::vector<TokenStreamRewriter::RewriteOperation*> &rewrites = *rewrites_ptr;
|
||||
|
||||
// WALK REPLACES
|
||||
for (size_t i = 0; i < rewrites.size(); ++i) {
|
||||
|
|
|
@ -267,7 +267,7 @@ namespace antlr4 {
|
|||
///
|
||||
/// Return a map from token index to operation.
|
||||
/// </summary>
|
||||
virtual std::unordered_map<size_t, RewriteOperation*> reduceToSingleOperationPerIndex(std::vector<RewriteOperation*> *rewrites);
|
||||
virtual std::unordered_map<size_t, RewriteOperation*> reduceToSingleOperationPerIndex(std::vector<RewriteOperation*> &rewrites);
|
||||
|
||||
virtual std::string catOpText(std::string *a, std::string *b);
|
||||
|
||||
|
|
Loading…
Reference in New Issue