Skip to content

Commit

Permalink
Merge pull request #637 from drewnoakes/simplify-string-creation
Browse files Browse the repository at this point in the history
Simplify string creation
  • Loading branch information
drewnoakes authored Nov 22, 2023
2 parents 62d0be5 + 33fbda2 commit 1e7b45c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Source/com/drew/metadata/StringValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.drew.lang.annotations.NotNull;
import com.drew.lang.annotations.Nullable;

import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;

/**
Expand Down Expand Up @@ -64,11 +63,7 @@ public String toString()
public String toString(@Nullable Charset charset)
{
if (charset != null) {
try {
return new String(_bytes, charset.name());
} catch (UnsupportedEncodingException ex) {
// fall through
}
return new String(_bytes, charset);
}

return new String(_bytes);
Expand Down

0 comments on commit 1e7b45c

Please sign in to comment.