From ad93bc7fda1988e49b4e3a0d85344d7e3dc7df10 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 21 May 2016 20:10:25 +0800 Subject: Parse - Updates for better memory efficiency (hopefully) --- src/include/span.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/include/span.hpp') diff --git a/src/include/span.hpp b/src/include/span.hpp index e5dd8ccc..f57fa8a9 100644 --- a/src/include/span.hpp +++ b/src/include/span.hpp @@ -5,9 +5,10 @@ * include/span.hpp * - Spans and error handling */ - #pragma once +#include + enum ErrorType { E0000, @@ -21,22 +22,22 @@ class Position; struct ProtoSpan { - ::std::string filename; + RcString filename; unsigned int start_line; unsigned int start_ofs; }; struct Span { - ::std::string filename; + RcString filename; unsigned int start_line; unsigned int start_ofs; unsigned int end_line; unsigned int end_ofs; - Span(::std::string filename, unsigned int start_line, unsigned int start_ofs, unsigned int end_line, unsigned int end_ofs): - filename(filename), + Span(RcString filename, unsigned int start_line, unsigned int start_ofs, unsigned int end_line, unsigned int end_ofs): + filename( ::std::move(filename) ), start_line(start_line), start_ofs(start_ofs), end_line(end_line), -- cgit v1.2.3