[Tizen.Log] Optimize separator
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 26 Jul 2022 08:55:47 +0000 (17:55 +0900)
committerhyotaekshim <35134695+hyotaekshim@users.noreply.github.com>
Tue, 26 Jul 2022 10:02:45 +0000 (19:02 +0900)
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/Tizen.Log/Tizen/Log.cs

index 927513a..dc4de93 100644 (file)
@@ -27,6 +27,7 @@ namespace Tizen
     /// <since_tizen> 3 </since_tizen>
     public class Log
     {
+        private static char[] sep = { '\\', '/' };
         /// <summary>
         /// Prints a log message with the VERBOSE priority.
         /// </summary>
@@ -119,7 +120,7 @@ namespace Tizen
             }
             else
             {
-                int index = file.LastIndexOfAny(new char[] { '\\', '/' });
+                int index = file.LastIndexOfAny(sep);
                 string filename = file.Substring(index + 1);
                 Interop.Dlog.Print(priority, tag, "%s: %s(%d) > %s", filename, func, line, message);
             }
@@ -133,6 +134,7 @@ namespace Tizen
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class InternalLog
     {
+        private static char[] sep = { '\\', '/' };
         /// <summary>
         /// Prints a log message with the VERBOSE priority.
         /// </summary>
@@ -226,7 +228,7 @@ namespace Tizen
             }
             else
             {
-                int index = file.LastIndexOfAny(new char[] { '\\', '/' });
+                int index = file.LastIndexOfAny(sep);
                 string filename = file.Substring(index + 1);
                 Interop.Dlog.InternalPrint(log_id, priority, tag, "%s: %s(%d) > %s", filename, func, line, message);
             }
@@ -240,6 +242,7 @@ namespace Tizen
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class SecureLog
     {
+        private static char[] sep = { '\\', '/' };
         /// <summary>
         /// Prints a log message with the VERBOSE priority.
         /// </summary>
@@ -334,7 +337,7 @@ namespace Tizen
             }
             else
             {
-                int index = file.LastIndexOfAny(new char[] { '\\', '/' });
+                int index = file.LastIndexOfAny(sep);
                 string filename = file.Substring(index + 1);
                 Interop.Dlog.InternalPrint(log_id, priority, tag, "%s: %s(%d) > %s", filename, func, line, message);
             }