mirror of
https://github.com/acpica/acpica/
synced 2025-02-22 16:34:24 +03:00
Add root node optimization to internal get namespace node function.
Detect a request for the root node (a lone backslash) up front before invoking a full namespace lookup.
This commit is contained in:
parent
29e066e019
commit
93f9f86221
@ -855,6 +855,8 @@ AcpiNsGetNode (
|
||||
ACPI_FUNCTION_TRACE_PTR (NsGetNode, ACPI_CAST_PTR (char, Pathname));
|
||||
|
||||
|
||||
/* Simplest case is a null pathname */
|
||||
|
||||
if (!Pathname)
|
||||
{
|
||||
*ReturnNode = PrefixNode;
|
||||
@ -865,6 +867,14 @@ AcpiNsGetNode (
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Quick check for a reference to the root */
|
||||
|
||||
if (ACPI_IS_ROOT_PREFIX (Pathname[0]) && (!Pathname[1]))
|
||||
{
|
||||
*ReturnNode = AcpiGbl_RootNode;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Convert path to internal representation */
|
||||
|
||||
Status = AcpiNsInternalizeName (Pathname, &InternalPath);
|
||||
|
Loading…
x
Reference in New Issue
Block a user