Skip to content

Commit 5eea6e3

Browse files
author
SlavaRa
committed
Replace 'string_value.Length <= 0' by 'string_value.Length == 0'
1 parent 71f0af8 commit 5eea6e3

File tree

16 files changed

+31
-31
lines changed

16 files changed

+31
-31
lines changed

External/Plugins/ASCompletion/Completion/ASComplete.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static public bool OnChar(ScintillaControl Sci, int Value, bool autoHide)
144144
case ' ':
145145
position--;
146146
string word = GetWordLeft(Sci, ref position);
147-
if (word.Length <= 0)
147+
if (word.Length == 0)
148148
{
149149
char c = (char)Sci.CharAt(position);
150150
if (c == ':' && features.hasEcmaTyping)

External/Plugins/ASCompletion/Completion/ASGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3405,7 +3405,7 @@ public static bool RenameMember(ScintillaControl Sci, MemberModel member, string
34053405
private static string GetPropertyNameFor(MemberModel member)
34063406
{
34073407
string name = member.Name;
3408-
if (name.Length < 1)
3408+
if (name.Length == 0)
34093409
return null;
34103410
Match parts = Regex.Match(name, "([^_$]*)[_$]+(.*)");
34113411
if (parts.Success)
@@ -3422,7 +3422,7 @@ private static string GetPropertyNameFor(MemberModel member)
34223422
/// </summary>
34233423
private static string GetNewPropertyNameFor(MemberModel member)
34243424
{
3425-
if (member.Name.Length < 1)
3425+
if (member.Name.Length == 0)
34263426
return "prop";
34273427
if (Regex.IsMatch(member.Name, "^[A-Z].*[a-z]"))
34283428
return Char.ToLower(member.Name[0]) + member.Name.Substring(1);

External/Plugins/ASCompletion/CustomControls/StateSavingTreeView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public void RestoreScrollState()
154154

155155
public TreeNode FindClosestPath(string path)
156156
{
157-
if (path == null || path.Length < 1) return null;
157+
if (string.IsNullOrEmpty(path)) return null;
158158
Queue queue = new Queue(path.Split('\\'));
159159
return FindClosestPath(base.Nodes,queue);
160160
}

External/Plugins/AirProperties/Forms/AirWizard.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,11 +1883,11 @@ private void ValidateFileTypes()
18831883
// always true;
18841884
fileType.DescriptionIsValid = true;
18851885
// set validity based on validation requirements
1886-
if (fileType.Name.Length <= 0) fileType.NameIsValid = false;
1886+
if (fileType.Name.Length == 0) fileType.NameIsValid = false;
18871887
else fileType.NameIsValid = true;
18881888
if (!Regex.IsMatch(fileType.Extension, _FileNameRegexPattern)) fileType.ExtensionIsValid = false;
18891889
else fileType.ExtensionIsValid = true;
1890-
if (fileType.ContentType.Length <= 0) fileType.ContentTypeIsValid = false;
1890+
if (fileType.ContentType.Length == 0) fileType.ContentTypeIsValid = false;
18911891
else fileType.ContentTypeIsValid = true;
18921892
foreach (PropertyManager.AirFileType.AirFileTypeIcon icon in fileType.Icons)
18931893
{
@@ -1964,7 +1964,7 @@ private void IDField_Validating(object sender, CancelEventArgs e)
19641964

19651965
private void VersionField_Validating(object sender, CancelEventArgs e)
19661966
{
1967-
if (VersionField.Text.Length <= 0 && PropertyManager.MajorVersion < PropertyManager.AirVersion.V25)
1967+
if (VersionField.Text.Length == 0 && PropertyManager.MajorVersion < PropertyManager.AirVersion.V25)
19681968
{
19691969
this.ValidationErrorProvider.SetError(VersionField, String.Format(TextHelper.GetString("Validation.InvalidProperty"), VersionLabel.Text));
19701970
e.Cancel = true;
@@ -2164,7 +2164,7 @@ private void FileTypeNameField_Validating(object sender, CancelEventArgs e)
21642164
{
21652165
FileTypeNameField.Text = FileTypeNameField.Text.Trim();
21662166
selectedFileType.Name = FileTypeNameField.Text;
2167-
if (FileTypeNameField.Text.Length <= 0)
2167+
if (FileTypeNameField.Text.Length == 0)
21682168
{
21692169
selectedFileType.NameIsValid = false;
21702170
this.ValidationErrorProvider.SetError(FileTypeNameField, String.Format(TextHelper.GetString("Validation.InvalidProperty"), FTNameLabel.Text));
@@ -2220,7 +2220,7 @@ private void FileTypeContentTypeField_Validating(object sender, CancelEventArgs
22202220
FileTypeContentTypeField.Text = FileTypeContentTypeField.Text.Trim();
22212221
selectedFileType.ContentType = FileTypeContentTypeField.Text;
22222222
// validate as required field for AIR 1.5+
2223-
if (FileTypeContentTypeField.Text.Length <= 0 && PropertyManager.MajorVersion >= PropertyManager.AirVersion.V15)
2223+
if (FileTypeContentTypeField.Text.Length == 0 && PropertyManager.MajorVersion >= PropertyManager.AirVersion.V15)
22242224
{
22252225
selectedFileType.ContentTypeIsValid = false;
22262226
this.ValidationErrorProvider.SetError(FileTypeContentTypeField, String.Format(TextHelper.GetString("Validation.InvalidProperty"), FTContentTypeLabel.Text));

External/Plugins/FlashDebugger/Debugger/ExpressionContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public ExpressionContext(Session session)
273273

274274
internal virtual void pushName(String name)
275275
{
276-
if (m_nameLocked || name.Length < 1) return;
276+
if (m_nameLocked || name.Length == 0) return;
277277
m_namedPath.Add(name);
278278
}
279279

External/Plugins/ProjectManager/Actions/BuildActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public bool Build(Project project, bool runOutput, bool releaseMode)
114114
return false;
115115
}
116116

117-
if (project.OutputPath.Length < 1)
117+
if (project.OutputPath.Length == 0)
118118
{
119119
String info = TextHelper.GetString("Info.SpecifyValidOutputSWF");
120120
ErrorManager.ShowInfo(info);

External/Plugins/ProjectManager/Controls/AS2/AS2PropertiesDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private void inputBrowseButton_Click(object sender, System.EventArgs e)
9393

9494
protected override bool Apply()
9595
{
96-
if (injectionCheckBox.Checked && inputSwfBox.Text.Length < 1)
96+
if (injectionCheckBox.Checked && inputSwfBox.Text.Length == 0)
9797
{
9898
string msg = TextHelper.GetString("Info.SpecifyInputSwfForInjection");
9999
ErrorManager.ShowInfo(msg);

External/Plugins/ProjectManager/Helpers/TreeViews/StateSavingTreeView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public void RestoreScrollState()
124124

125125
private TreeNode FindClosestPath(string path)
126126
{
127-
if (path == null || path.Length < 1) return null;
127+
if (string.IsNullOrEmpty(path)) return null;
128128
Queue queue = new Queue(path.Split('\\'));
129129
return FindClosestPath(base.Nodes,queue);
130130
}

FlashDevelop/Dialogs/FRInDocDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ private List<SearchMatch> GetResults(ScintillaControl sci)
695695
private bool IsValidPattern()
696696
{
697697
String pattern = this.findComboBox.Text;
698-
if (pattern.Length < 1) return false;
698+
if (pattern.Length == 0) return false;
699699
if (this.useRegexCheckBox.Checked)
700700
{
701701
try

FlashDevelop/Dialogs/FRInFilesDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ private Boolean IsFileHidden(String file, IProject project)
994994
private Boolean IsValidPattern()
995995
{
996996
String pattern = this.findComboBox.Text;
997-
if (pattern.Length < 1) return false;
997+
if (pattern.Length == 0) return false;
998998
if (this.regexCheckBox.Checked)
999999
{
10001000
try

0 commit comments

Comments
 (0)