natString.cc (substring): optimize where substring is entire String.
1999-07-22 Bryce McKinlay <bryce@albatross.co.nz> * java/lang/natString.cc (substring): optimize where substring is entire String. * java/io/File.java (getName): don't return separator with file name. * java/io/natFile.cc (attr): fix overflow. From-SVN: r28246
This commit is contained in:
parent
648d2ffce8
commit
41296e2a23
4 changed files with 11 additions and 4 deletions
|
@ -108,9 +108,7 @@ public class File implements Serializable
|
|||
public String getName ()
|
||||
{
|
||||
int last = path.lastIndexOf(separatorChar);
|
||||
if (last == -1)
|
||||
last = 0;
|
||||
return path.substring(last);
|
||||
return path.substring(last + 1);
|
||||
}
|
||||
|
||||
public String getParent ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue