mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
ReSharper: remove redundant code
This commit is contained in:
@@ -28,7 +28,7 @@ namespace Wox.Infrastructure
|
||||
|
||||
public MatchResult Evaluate(string str)
|
||||
{
|
||||
if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(query)) return new MatchResult() { Success = false };
|
||||
if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(query)) return new MatchResult { Success = false };
|
||||
|
||||
var len = str.Length;
|
||||
var compareString = opt.IgnoreCase ? str.ToLower() : str;
|
||||
@@ -67,7 +67,7 @@ namespace Wox.Infrastructure
|
||||
// return rendered string if we have a match for every char
|
||||
if (patternIdx == pattern.Length)
|
||||
{
|
||||
return new MatchResult()
|
||||
return new MatchResult
|
||||
{
|
||||
Success = true,
|
||||
Value = sb.ToString(),
|
||||
@@ -75,7 +75,7 @@ namespace Wox.Infrastructure
|
||||
};
|
||||
}
|
||||
|
||||
return new MatchResult() { Success = false };
|
||||
return new MatchResult { Success = false };
|
||||
}
|
||||
|
||||
private int CalScore(string str, int firstIndex, int matchLen)
|
||||
@@ -107,9 +107,9 @@ namespace Wox.Infrastructure
|
||||
{
|
||||
public MatchOption()
|
||||
{
|
||||
this.Prefix = "";
|
||||
this.Suffix = "";
|
||||
this.IgnoreCase = true;
|
||||
Prefix = "";
|
||||
Suffix = "";
|
||||
IgnoreCase = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace Wox.Infrastructure.Hotkey
|
||||
if (CharKey != Key.None)
|
||||
{
|
||||
text += specialSymbolDictionary.ContainsKey(CharKey)
|
||||
? specialSymbolDictionary[CharKey].ToString()
|
||||
? specialSymbolDictionary[CharKey]
|
||||
: CharKey.ToString();
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(text))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Wox.Infrastructure.Hotkey
|
||||
{
|
||||
public enum KeyEvent:int
|
||||
public enum KeyEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Key down
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Infrastructure.Http
|
||||
@@ -56,7 +57,7 @@ namespace Wox.Infrastructure.Http
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Logger.Log.Error(e);
|
||||
Log.Error(e);
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -109,7 +110,7 @@ namespace Wox.Infrastructure.Http
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Logger.Log.Error(e);
|
||||
Log.Error(e);
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using NLog;
|
||||
using Wox.Infrastructure.Exception;
|
||||
|
||||
namespace Wox.Infrastructure.Logger
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Wox.Infrastructure.Storage
|
||||
}
|
||||
}
|
||||
|
||||
private System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
|
||||
private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
|
||||
{
|
||||
Assembly ayResult = null;
|
||||
string sShortAssemblyName = args.Name.Split(',')[0];
|
||||
|
||||
Reference in New Issue
Block a user