Skip to content
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

RemoveWarmupPeriods has extra enumeration with ToList() #1314

Open
DaveSkender opened this issue Jan 5, 2025 Discussed in #1310 · 0 comments
Open

RemoveWarmupPeriods has extra enumeration with ToList() #1314

DaveSkender opened this issue Jan 5, 2025 Discussed in #1310 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@DaveSkender
Copy link
Owner

DaveSkender commented Jan 5, 2025

Problem: extra list enumeration (performance)

Other considerations

  • also for Prune() and related utilities
  • v3 approach coordination
// current v2 approach
public static IEnumerable<BollingerBandsResult> RemoveWarmupPeriods(
    this IEnumerable<BollingerBandsResult> results)
{
    int removePeriods = results
        .ToList()
        .FindIndex(x => x.Width != null);

    return results.Remove(removePeriods);
}

Discussed in #1310

Originally posted by **martonb** January 5, 2025 Just noticed, RemoveWarmupPeriods for Bollinger Bands uses a ToList, which looks unnecessary, to me... Any reason for it or just mistake?
@DaveSkender DaveSkender added the enhancement New feature or request label Jan 5, 2025
@DaveSkender DaveSkender added this to the v3 milestone Jan 5, 2025
@DaveSkender DaveSkender changed the title Does RemoveWarmupPeriods needs ToList()? RemoveWarmupPeriods has extra enumerates with ToList() Jan 6, 2025
@DaveSkender DaveSkender changed the title RemoveWarmupPeriods has extra enumerates with ToList() RemoveWarmupPeriods has extra enumeration with ToList() Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant