1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-09 06:15:49 +02:00

Add StringUtils.EmptyArray and use it instead of new string[0]

This commit is contained in:
chylex 2017-07-21 12:37:30 +02:00
parent b35e4d4d01
commit 85f923a6fc
3 changed files with 5 additions and 3 deletions

View File

@ -10,11 +10,11 @@ sealed class TweetDeckBridge{
public static string LastRightClickedImage = string.Empty;
public static string LastHighlightedTweet = string.Empty;
public static string LastHighlightedQuotedTweet = string.Empty;
public static string[] LastHighlightedTweetImages = new string[0];
public static string[] LastHighlightedTweetImages = StringUtils.EmptyArray;
public static void ResetStaticProperties(){
LastRightClickedLink = LastRightClickedImage = LastHighlightedTweet = LastHighlightedQuotedTweet = string.Empty;
LastHighlightedTweetImages = new string[0];
LastHighlightedTweetImages = StringUtils.EmptyArray;
}
private readonly FormBrowser form;

View File

@ -4,6 +4,8 @@
namespace TweetDuck.Core.Utils{
static class StringUtils{
public static readonly string[] EmptyArray = new string[0];
public static string ExtractBefore(string str, char search, int startIndex = 0){
int index = str.IndexOf(search, startIndex);
return index == -1 ? str : str.Substring(0, index);

View File

@ -103,7 +103,7 @@ public string KeyName{
public string[] KeyValue{
get{
int index = Identifier.IndexOf(KeySeparator);
return index == -1 ? new string[0] : Identifier.Substring(index+1).Split(KeySeparator);
return index == -1 ? StringUtils.EmptyArray : Identifier.Substring(index+1).Split(KeySeparator);
}
}