Skip to content

Commit

Permalink
refactor: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
miurahr committed May 18, 2024
1 parent be0d1f8 commit 7985005
Showing 1 changed file with 11 additions and 24 deletions.
35 changes: 11 additions & 24 deletions src/main/java/org/dts/spell/dictionary/myspell/AffixMgr.java
Original file line number Diff line number Diff line change
Expand Up @@ -353,24 +353,7 @@ public boolean get_nosplitsugs()
{
return nosplitsugs;
}

public static String readEncoding(String affpath) throws IOException
{
FileInputStream rd = null ;

try
{
// we suppose that first line is in US-ASCII
rd = new FileInputStream(affpath) ;

return readEncoding(rd) ;
}
finally
{
Utils.close(rd) ;
}
}


private static String readLine(InputStream affStream) throws IOException
{
StringBuilder builder = new StringBuilder(20) ;
Expand Down Expand Up @@ -399,12 +382,16 @@ private static boolean canSkip(String line)
public static String readEncoding(InputStream affStream) throws IOException
{
// we suppose that to the first line with is no a comment is in US-ASCII
String line = readLine(affStream) ;

while (null != line && canSkip(line))
line = readLine(affStream) ;

return parseEncoding(line) ;
try {
String line = readLine(affStream);

while (null != line && canSkip(line))
line = readLine(affStream);

return parseEncoding(line) ;
} catch (Exception e) {
throw e;
}
}


Expand Down

0 comments on commit 7985005

Please sign in to comment.