-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Efficiency enhancements #1829
Efficiency enhancements #1829
Conversation
Eliminate double-searching of CommentStore
Clearer variable type, remove redundant casts
Make callbacks static for simplicity
Join declaration and initialisation
Simplify list generation logic
Remove redundant counting of list size
Avoid thread-thrashing if yes or no to all has been clicked
Fix duplicate Dispose calls
Make fake conditional value a constant
String interpolation, object initialisers
foreach (var f in selected) | ||
using (var stream = File.Open(f.FullName, FileMode.Open)) | ||
{ | ||
shareManager.ImportSharedObject(stream); | ||
} | ||
{ | ||
using var stream = File.Open(f.FullName, FileMode.Open); | ||
shareManager.ImportSharedObject(stream); | ||
} |
Check notice
Code scanning / CodeQL
Missed opportunity to use Select Note
maps its iteration variable to another variable
foreach (var xml in Directory.EnumerateFiles(location, "*.xml", SearchOption.AllDirectories)) | ||
using (var content = File.OpenRead(xml)) | ||
{ | ||
ReadComments(content); | ||
} | ||
{ | ||
using var content = File.OpenRead(xml); | ||
ReadComments(content); | ||
} |
Check notice
Code scanning / CodeQL
Missed opportunity to use Select Note
maps its iteration variable to another variable
foreach (var zipFile in new[] { zipArchive }.Union(SupplementalSourceZipFiles).Where(static zipFile => zipFile.Exists)) | ||
{ | ||
using var z = ZipFile.OpenRead(zipFile.FullName); | ||
foreach (var entry in z.Entries) | ||
entries.Add(entry.Name); | ||
} |
Check notice
Code scanning / CodeQL
Missed opportunity to use Select Note
maps its iteration variable to another variable
@@ -69,7 +69,7 @@ | |||
return; | |||
} | |||
|
|||
_alreadyMarkedInConfiguration = _selectedDataSetColumns.Where(c => Getter(c)).ToArray(); | |||
_alreadyMarkedInConfiguration = _selectedDataSetColumns.Where(Getter).ToArray(); |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
@@ -81,7 +81,7 @@ | |||
return; | |||
} | |||
|
|||
_alreadyMarked = _extractionInformations.Where(c => Getter(c)).ToArray(); | |||
_alreadyMarked = _extractionInformations.Where(Getter).ToArray(); |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
@@ -80,19 +80,18 @@ | |||
/// <inheritdoc/> | |||
public override bool Equals(object obj) | |||
{ | |||
if (obj is QueryTimeColumn == false) | |||
throw new Exception(".Equals only works for objects of type QueryTimeColumn"); | |||
if (obj is QueryTimeColumn other) |
Check warning
Code scanning / CodeQL
Equals should not apply "is" Warning
Proposed Change
Summarise your proposed changes here, including any notes for reviewers.
Type of change
What types of changes does your code introduce? Tick all that apply.
Checklist
By opening this PR, I confirm that I have: