From 1496991096c4db9f69bc572aeefc8099ca0f0c01 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 10 Sep 2013 21:50:05 -0400 Subject: use StringBuilder in GetValidFilename --- MediaBrowser.Controller/IO/FileSystem.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Controller/IO/FileSystem.cs') diff --git a/MediaBrowser.Controller/IO/FileSystem.cs b/MediaBrowser.Controller/IO/FileSystem.cs index e5f80533a..3d425f13f 100644 --- a/MediaBrowser.Controller/IO/FileSystem.cs +++ b/MediaBrowser.Controller/IO/FileSystem.cs @@ -106,13 +106,15 @@ namespace MediaBrowser.Controller.IO { throw new ArgumentNullException("filename"); } + + var builder = new StringBuilder(filename); foreach (var c in InvalidFileNameChars) { - filename = filename.Replace(c, SpaceChar); + builder = builder.Replace(c, SpaceChar); } - return filename; + return builder.ToString(); } /// -- cgit v1.2.3