Skip to content

Commit

Permalink
Update Gradle parsing to reduce calls to IsDevDependencyByLockfile (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cobya authored Jun 6, 2024
1 parent 72abdcc commit 3145e53
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ private void ParseLockfile(ISingleFileComponentRecorder singleFileComponentRecor
}

var lines = new List<string>(text.Split("\n"));
var devDepLockFile = this.IsDevDependencyByLockfile(file);

while (lines.Count > 0)
{
Expand All @@ -80,7 +81,7 @@ private void ParseLockfile(ISingleFileComponentRecorder singleFileComponentRecor
if (line.Split(":").Length == 3)
{
var detectedMavenComponent = new DetectedComponent(this.CreateMavenComponentFromFileLine(line));
var devDependency = this.IsDevDependencyByLockfile(file) || this.IsDevDependencyByConfigurations(line);
var devDependency = devDepLockFile || this.IsDevDependencyByConfigurations(line);
singleFileComponentRecorder.RegisterUsage(detectedMavenComponent, isDevelopmentDependency: devDependency);
}
}
Expand Down

0 comments on commit 3145e53

Please sign in to comment.