mirror of
https://github.com/apple/pkl.git
synced 2026-04-23 16:58:37 +02:00
pkl-parser: Represent "no children" as an empty list instead of null (#1513)
Motivation: Facilitate the use of the NullAway checker as part of moving to JSpecify. Changes: - represent "no children" as `List.of()` instead of null - remove obsolete `children != null` assertions - NullAway intentionally ignores such assertions - remove "no children" special-casing where no longer necessary Result: - cleaner code with similar performance - removed a barrier to using the NullAway checker
This commit is contained in:
@@ -219,9 +219,6 @@ public class PowerAssertions {
|
||||
return parserNode;
|
||||
}
|
||||
var children = parserNode.children();
|
||||
if (children == null) {
|
||||
return null;
|
||||
}
|
||||
for (var child : children) {
|
||||
var found = findParserNode(node, child, offset);
|
||||
if (found != null) {
|
||||
|
||||
Reference in New Issue
Block a user