Index: tools/skimage_main.cpp |
diff --git a/tools/skimage_main.cpp b/tools/skimage_main.cpp |
index 7a1954a07237b61afdb5eceb3bee88276e865ef5..7be2c4d9b110c019cdd02ac80d06b29ae22d2552 100644 |
--- a/tools/skimage_main.cpp |
+++ b/tools/skimage_main.cpp |
@@ -464,24 +464,6 @@ static void test_stream_without_length(const char srcPath[], SkImageDecoder* cod |
} |
#endif // defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_UNIX) |
-/** |
- * Replaces all instances of oldChar with newChar in str. |
- * |
- * TODO: This function appears here and in picture_utils.[cpp|h] ; |
- * we should add the implementation to src/core/SkString.cpp, write tests for it, |
- * and remove it from elsewhere. |
- */ |
-static void replace_char(SkString* str, const char oldChar, const char newChar) { |
- if (NULL == str) { |
- return; |
- } |
- for (size_t i = 0; i < str->size(); ++i) { |
- if (oldChar == str->operator[](i)) { |
- str->operator[](i) = newChar; |
- } |
- } |
-} |
- |
static void decodeFileAndWrite(const char srcPath[], const SkString* writePath) { |
SkBitmap bitmap; |
SkFILEStream stream(srcPath); |
@@ -506,10 +488,10 @@ static void decodeFileAndWrite(const char srcPath[], const SkString* writePath) |
// Create a string representing just the filename itself, for use in json expectations. |
SkString basename = SkOSPath::Basename(srcPath); |
// Replace '_' with '-', so that the names can fit gm_json.py's IMAGE_FILENAME_PATTERN |
- replace_char(&basename, '_', '-'); |
+ basename.replace('_', '-'); |
// Replace '.' with '-', so the output filename can still retain the original file extension, |
// but still end up with only one '.', which denotes the actual extension of the final file. |
- replace_char(&basename, '.', '-'); |
+ basename.replace('.', '-'); |
const char* filename = basename.c_str(); |
if (!codec->decode(&stream, &bitmap, gPrefColorType, SkImageDecoder::kDecodePixels_Mode)) { |