From 5b99eeae61a3b9674bebe863f51a23c6b0b5cb18 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Wed, 4 Oct 2023 12:01:10 -0700 Subject: [PATCH] small tweak --- .../com/linkedin/d2/xds/XdsToD2PropertiesAdaptor.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/d2/src/main/java/com/linkedin/d2/xds/XdsToD2PropertiesAdaptor.java b/d2/src/main/java/com/linkedin/d2/xds/XdsToD2PropertiesAdaptor.java index 4647f3c27c..2bba859484 100644 --- a/d2/src/main/java/com/linkedin/d2/xds/XdsToD2PropertiesAdaptor.java +++ b/d2/src/main/java/com/linkedin/d2/xds/XdsToD2PropertiesAdaptor.java @@ -354,15 +354,7 @@ private String getSymlink(String actualNodeName) { private static String getNodeName(String path) { - int idx = path.lastIndexOf(PATH_SEPARATOR); - if (idx == -1) - { - return path; - } - else - { - return path.substring(idx + 1); - } + return path.substring(path.lastIndexOf(PATH_SEPARATOR) + 1); } private void notifyAvailabilityChanges(boolean isAvailable)