mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Clean up pointer use:
* Use unique_ptr for Actions instead of manual memory management * Use unique_ptr in KeywordDatabase * Use unique_ptr instead of shared_ptr for file formats * Don't pass shared_ptr to Reader/Writer, use references instead Also * Switch to C++17 so we can use map::try_emplace
This commit is contained in:
@@ -213,9 +213,9 @@ void TokenIterator::readToken() {
|
||||
// read the entire file, and start at the beginning of it
|
||||
pos = 0;
|
||||
filename = include_file;
|
||||
InputStreamP is = package_manager.openFileFromPackage(package, include_file);
|
||||
eat_utf8_bom(*is);
|
||||
input = read_utf8_line(*is, true);
|
||||
auto stream = package_manager.openFileFromPackage(package, include_file);
|
||||
eat_utf8_bom(*stream);
|
||||
input = read_utf8_line(*stream, true);
|
||||
} else if (isAlpha(c) || isUnicodeAlpha(c) || c == _('_') || (isDigit(c) && !buffer.empty() && buffer.back() == _("."))) {
|
||||
// name, or a number after a . token, as in array.0
|
||||
size_t start = pos - 1;
|
||||
|
||||
Reference in New Issue
Block a user