Skip to content

Commit fe3ebf9

Browse files
committed
return SmallVector from followAllReferences()
1 parent 7dadde0 commit fe3ebf9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/astutils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ static void followVariableExpressionError(const Token *tok1, const Token *tok2,
987987
errors->push_back(item);
988988
}
989989

990-
std::vector<ReferenceToken> followAllReferences(const Token* tok,
990+
SmallVector<ReferenceToken> followAllReferences(const Token* tok,
991991
bool temporary,
992992
bool inconclusive,
993993
ErrorPath errors,

lib/astutils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include "config.h"
3232
#include "errortypes.h"
33+
#include "smallvector.h"
3334
#include "symboldatabase.h"
3435

3536
class Function;
@@ -194,7 +195,7 @@ struct ReferenceToken {
194195
ErrorPath errors;
195196
};
196197

197-
std::vector<ReferenceToken> followAllReferences(const Token* tok,
198+
SmallVector<ReferenceToken> followAllReferences(const Token* tok,
198199
bool temporary = true,
199200
bool inconclusive = true,
200201
ErrorPath errors = ErrorPath{},

lib/smallvector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include <cstddef>
2323

24-
static constexpr std::size_t DefaultSmallVectorSize = 0;
24+
static constexpr std::size_t DefaultSmallVectorSize = 3;
2525

2626
#ifdef HAVE_BOOST
2727
#include <boost/container/small_vector.hpp>

0 commit comments

Comments
 (0)