Skip to content

Commit acafdb6

Browse files
PKEuSdanmar
authored andcommitted
Refactorization: Reduced stack usage of givenACodeSampleToTokenize
Merged from LCppC.
1 parent 4678a9c commit acafdb6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

test/testutils.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

19-
19+
#include "testutils.h"
2020
#include "testsuite.h"
2121
#include "utils.h"
2222

23+
const Settings givenACodeSampleToTokenize::settings;
24+
2325
class TestUtils : public TestFixture {
2426
public:
2527
TestUtils() : TestFixture("TestUtils") {

test/testutils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class Token;
2626

2727
class givenACodeSampleToTokenize {
2828
private:
29-
Settings settings;
3029
Tokenizer tokenizer;
30+
static const Settings settings;
3131

3232
public:
3333
explicit givenACodeSampleToTokenize(const char sample[], bool createOnly = false, bool cpp = true)

0 commit comments

Comments
 (0)