From 10120b53c29b706596f8eaf37fb1449d865beb92 Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Wed, 23 Jul 2014 02:18:00 +0200 Subject: [PATCH] Static nested function in Scanner to avoid deleg overhead. --- source/dyaml/scanner.d | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/dyaml/scanner.d b/source/dyaml/scanner.d index b282bec..85df46a 100644 --- a/source/dyaml/scanner.d +++ b/source/dyaml/scanner.d @@ -1481,13 +1481,13 @@ final class Scanner const lineBreak = scanLineBreak(); allowSimpleKey_ = true; - bool end() + static bool end(Reader reader) { - return ["---"d, "..."d].canFind(reader_.prefix(3)) && - " \t\0\n\r\u0085\u2028\u2029"d.canFind(reader_.peek(3)); + return ["---"d, "..."d].canFind(reader.prefix(3)) && + " \t\0\n\r\u0085\u2028\u2029"d.canFind(reader.peek(3)); } - if(end()){return "";} + if(end(reader_)) { return ""; } dstring breaks; while(" \n\r\u0085\u2028\u2029"d.canFind(reader_.peek())) @@ -1496,7 +1496,7 @@ final class Scanner else { breaks ~= scanLineBreak(); - if(end()){return "";} + if(end(reader_)) { return ""; } } }