mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2026-11-02 11:37:37 +00:00
効率化
This commit is contained in:
1 file changed
+6
-2
@@ -21,18 +21,22 @@ public class PublicPath {
|
|||||||
this.path.add(path);
|
this.path.add(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PublicPath resolve(String path) {
|
private void resolveInternal(String path) {
|
||||||
if (path.equals("..")) {
|
if (path.equals("..")) {
|
||||||
this.path.remove(this.path.size() - 1);
|
this.path.remove(this.path.size() - 1);
|
||||||
} else {
|
} else {
|
||||||
add(path);
|
add(path);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public PublicPath resolve(String path) {
|
||||||
|
resolveInternal(path);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PublicPath resolve(List<String> path) {
|
public PublicPath resolve(List<String> path) {
|
||||||
for (String p : path) {
|
for (String p : path) {
|
||||||
resolve(p);
|
resolveInternal(p);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user