mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
効率化
This commit is contained in:
parent
04651f3b8e
commit
171c8b380c
|
@ -21,18 +21,22 @@ public class PublicPath {
|
|||
this.path.add(path);
|
||||
}
|
||||
|
||||
public PublicPath resolve(String path) {
|
||||
private void resolveInternal(String path) {
|
||||
if (path.equals("..")) {
|
||||
this.path.remove(this.path.size() - 1);
|
||||
} else {
|
||||
add(path);
|
||||
}
|
||||
}
|
||||
|
||||
public PublicPath resolve(String path) {
|
||||
resolveInternal(path);
|
||||
return this;
|
||||
}
|
||||
|
||||
public PublicPath resolve(List<String> path) {
|
||||
for (String p : path) {
|
||||
resolve(p);
|
||||
resolveInternal(p);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user