Skip to content

Commit

Permalink
Use string.IsNullOrWhitespace for empty line check
Browse files Browse the repository at this point in the history
  • Loading branch information
AristurtleDev committed Apr 29, 2024
1 parent 4df7321 commit 9232ca5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/BuildLinuxTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public override void Run(BuildContext context)

private static string GetFFMpegConfigureFlags(BuildContext context)
{
var ignoreCommentsAndNewLines = (string line) => !line.StartsWith('#') && !line.StartsWith(' ');
var ignoreCommentsAndNewLines = (string line) => !string.IsNullOrWhiteSpace(line) && !line.StartsWith('#');
var configureFlags = context.FileReadLines("ffprobe.config").Where(ignoreCommentsAndNewLines);
var osConfigureFlags = context.FileReadLines($"ffprobe.linux-x64.config").Where(ignoreCommentsAndNewLines);
return string.Join(' ', configureFlags) + " " + string.Join(' ', osConfigureFlags);
Expand Down
2 changes: 1 addition & 1 deletion build/BuildMacOSTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private static void BuildX64(BuildContext context)

private static string GetFFMpegConfigureFlags(BuildContext context, string rid)
{
var ignoreCommentsAndNewLines = (string line) => !line.StartsWith('#') && !line.StartsWith(' ');
var ignoreCommentsAndNewLines = (string line) => !string.IsNullOrWhiteSpace(line) && !line.StartsWith('#');
var configureFlags = context.FileReadLines("ffprobe.config").Where(ignoreCommentsAndNewLines);
var osConfigureFlags = context.FileReadLines($"ffprobe.{rid}.config").Where(ignoreCommentsAndNewLines);
return string.Join(' ', configureFlags) + " " + string.Join(' ', osConfigureFlags);
Expand Down
2 changes: 1 addition & 1 deletion build/BuildWIndowsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public override void Run(BuildContext context)

private static string GetFFProbConfigureFlags(BuildContext context)
{
var ignoreCommentsAndNewLines = (string line) => !line.StartsWith('#') && !line.StartsWith(' ');
var ignoreCommentsAndNewLines = (string line) => !string.IsNullOrWhiteSpace(line) && !line.StartsWith('#');
var configureFlags = context.FileReadLines("ffprobe.config").Where(ignoreCommentsAndNewLines);
var osConfigureFlags = context.FileReadLines($"ffprobe.windows-x64.config").Where(ignoreCommentsAndNewLines);
return string.Join(' ', configureFlags) + " " + string.Join(' ', osConfigureFlags);
Expand Down

0 comments on commit 9232ca5

Please sign in to comment.