summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2023-02-24 22:50:40 +0000
committerLinus Groh <mail@linusgroh.de>2023-02-24 23:56:37 +0100
commitf8bdb584f8552f553c106fc7b32d5129913d8cd0 (patch)
treef836b478f54f3557664ed747a2ce69f00e7ffb42
parent69f0339bacb5ab6ace866a0d2ee6ce277ac82665 (diff)
downloadserenity-f8bdb584f8552f553c106fc7b32d5129913d8cd0.zip
LibDeviceTree: Use unchecked_append() in path parsing
try_append() checks if the vector should increase capacity and if so grows the vector. unchecked_append() verifies the vector already has enough capacity, and will never grow the vector.
-rw-r--r--Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.cpp b/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.cpp
index d44f2c958f..369a714399 100644
--- a/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.cpp
+++ b/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.cpp
@@ -117,7 +117,7 @@ static ErrorOr<ReadonlyBytes> slow_get_property_raw(StringView name, FlattenedDe
return Error::from_errno(ENAMETOOLONG);
}
// This can never fail as all entries go into the inline buffer, enforced by the check above.
- MUST(path.try_append(view));
+ path.unchecked_append(view);
return {};
}));