You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when accessing a single element) * Removed subscript operator, in favor of a more explicit `get` * Added conversion from `Iterator` to `ConstIterator` * Remade existing operations into other solutions when applicable
This commit is contained in:
@@ -573,7 +573,7 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
|
||||
const List<GDScriptParser::ParserError> &errors = parser.get_errors();
|
||||
if (!errors.is_empty()) {
|
||||
// Only the first error since the following might be cascading.
|
||||
result.output += errors[0].message + "\n"; // TODO: line, column?
|
||||
result.output += errors.front()->get().message + "\n"; // TODO: line, column?
|
||||
}
|
||||
if (!p_is_generating) {
|
||||
result.passed = check_output(result.output);
|
||||
@@ -592,7 +592,7 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
|
||||
const List<GDScriptParser::ParserError> &errors = parser.get_errors();
|
||||
if (!errors.is_empty()) {
|
||||
// Only the first error since the following might be cascading.
|
||||
result.output += errors[0].message + "\n"; // TODO: line, column?
|
||||
result.output += errors.front()->get().message + "\n"; // TODO: line, column?
|
||||
}
|
||||
if (!p_is_generating) {
|
||||
result.passed = check_output(result.output);
|
||||
|
||||
Reference in New Issue
Block a user