Skip to content

Commit b012407

Browse files
committed
Merge pull request #957 from SlavaRa/feature/refactor_Type_cast_is_redundant
[Code cleanup] Fixes redundant Type cast
2 parents 5d4285b + b98dee4 commit b012407

File tree

33 files changed

+53
-52
lines changed

33 files changed

+53
-52
lines changed

External/Plugins/AS3Context/Compiler/FlexDebugger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static void debugger_OnStarted(string line)
5454
{
5555
if (startMessage == null)
5656
return;
57-
PluginBase.RunAsync((MethodInvoker)delegate
57+
PluginBase.RunAsync(delegate
5858
{
5959
// send message again
6060
ignoreMessage = true;

External/Plugins/AS3Context/Compiler/FlexShells.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ private void ascRunner_Error(object sender, string line)
508508
private void ascRunner_OutputError(object sender, string line)
509509
{
510510
if (line == null) return;
511-
PluginBase.RunAsync((MethodInvoker)delegate
511+
PluginBase.RunAsync(delegate
512512
{
513513
if (line.StartsWith("Exception "))
514514
{
@@ -563,7 +563,7 @@ private void mxmlcRunner_Error(object sender, string line)
563563

564564
private void mxmlcRunner_Output(object sender, string line)
565565
{
566-
PluginBase.RunAsync((MethodInvoker)delegate
566+
PluginBase.RunAsync(delegate
567567
{
568568
if (!notificationSent && line.StartsWith("Done("))
569569
{

External/Plugins/AS3Context/PluginMain.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Object IPlugin.Settings
9999

100100
static public AS3Settings Settings
101101
{
102-
get { return settingObject as AS3Settings; }
102+
get { return settingObject; }
103103
}
104104
#endregion
105105

@@ -156,13 +156,13 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
156156
if (PluginBase.CurrentProject != null && PluginBase.CurrentProject.Language == "as3")
157157
e.Handled = OpenVirtualFileModel(de.Data as String);
158158
}
159-
else if (!(settingObject as AS3Settings).DisableFDB && action == "AS3Context.StartDebugger")
159+
else if (!settingObject.DisableFDB && action == "AS3Context.StartDebugger")
160160
{
161161
string workDir = (PluginBase.CurrentProject != null)
162162
? Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath)
163163
: Environment.CurrentDirectory;
164164

165-
string flexSdk = (settingObject as AS3Settings).GetDefaultSDK().Path;
165+
string flexSdk = settingObject.GetDefaultSDK().Path;
166166

167167
// if the default sdk is not defined ask for project sdk
168168
if (String.IsNullOrEmpty(flexSdk))

External/Plugins/ASCompletion/Context/ASContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ public virtual bool SetTemporaryPath(string path)
691691
return false;
692692
if (temporaryPath != null)
693693
{
694-
while (classPath.Count > 0 && (classPath[0] as PathModel).IsTemporaryPath)
694+
while (classPath.Count > 0 && classPath[0].IsTemporaryPath)
695695
{
696696
classPath[0].InUse = false;
697697
classPath.RemoveAt(0);

External/Plugins/ASCompletion/Model/ClassModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public string GenerateIntrinsic(bool caching)
306306
char semi = ';';
307307
string tab0 = (!caching && InFile.Version == 3) ? "\t" : "";
308308
string tab = (caching) ? "" : ((InFile.Version == 3) ? "\t\t" : "\t");
309-
bool preventVis = (bool)((this.Flags & FlagType.Interface) > 0);
309+
bool preventVis = (this.Flags & FlagType.Interface) > 0;
310310

311311
// SPECIAL DELEGATE
312312
/*if ((Flags & FlagType.Delegate) > 0)

External/Plugins/ASCompletion/Model/PathExplorer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private bool ParseFoundFiles()
284284
{
285285
if (stopExploration) return writeCache;
286286
// parse
287-
filename = foundFiles[i] as string;
287+
filename = foundFiles[i];
288288
if (!File.Exists(filename))
289289
continue;
290290
if (pathModel.HasFile(filename))

External/Plugins/ASCompletion/Model/PathModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static public PathModel GetModel(string path, IASContext context)
6868
PathModel aPath;
6969
if (pathes.ContainsKey(modelName))
7070
{
71-
aPath = pathes[modelName] as PathModel;
71+
aPath = pathes[modelName];
7272
if (aPath.IsTemporaryPath || !aPath.IsValid || aPath.FilesCount == 0)
7373
{
7474
pathes[modelName] = aPath = new PathModel(path, context);

External/Plugins/AirProperties/Forms/AirWizard.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ private String GetSelectedLocale()
432432

433433
private Boolean GetSelectedLocaleIsDefault()
434434
{
435-
return (Boolean)(LocalesField.SelectedIndex == 0);
435+
return LocalesField.SelectedIndex == 0;
436436
}
437437

438438
public void SetTitle(string projectName, string airVersion)
@@ -1473,8 +1473,8 @@ private void LocaleManagerButton_Click(object sender, EventArgs e)
14731473
{
14741474
//create the affected properties now, even though value is empty, so the locale
14751475
//will be preserved if the user closes the form without specifying a value
1476-
PropertyManager.CreateLocalizedProperty("name", locale, (Boolean)_locales[0].Equals(locale));
1477-
PropertyManager.CreateLocalizedProperty("description", locale, (Boolean)_locales[0].Equals(locale));
1476+
PropertyManager.CreateLocalizedProperty("name", locale, _locales[0].Equals(locale));
1477+
PropertyManager.CreateLocalizedProperty("description", locale, _locales[0].Equals(locale));
14781478
}
14791479
}
14801480
//Re-initialize locales and refresh affected property fields

External/Plugins/CodeFormatter/Handlers/MXMLLexer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public class MXMLLexer : Lexer {
5050
int lastCharPos=0;
5151
public void AddToken( CommonToken t, int type, int channel)
5252
{
53-
((CommonToken)t).Type = type;
54-
((CommonToken)t).Channel = channel;
53+
t.Type = type;
54+
t.Channel = channel;
5555
t.Line = lastLine;
5656
lastLine=input.Line;
5757
t.CharPositionInLine = lastCharPos;
5858
lastCharPos=input.CharPositionInLine;
59-
mRawTokens.Add((CommonToken)t);
59+
mRawTokens.Add(t);
6060
}
6161
public List<CommonToken> GetTokens()
6262
{

External/Plugins/CodeFormatter/PluginMain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public void InitBasics()
166166
private void UpdateMenuItems()
167167
{
168168
if (this.mainMenuItem == null || this.contextMenuItem == null) return;
169-
ITabbedDocument doc = PluginBase.MainForm.CurrentDocument as ITabbedDocument;
169+
ITabbedDocument doc = PluginBase.MainForm.CurrentDocument;
170170
Boolean isValid = doc != null && doc.IsEditable && this.IsSupportedLanguage(doc.FileName);
171171
this.mainMenuItem.Enabled = this.contextMenuItem.Enabled = isValid;
172172
}

0 commit comments

Comments
 (0)