-
Notifications
You must be signed in to change notification settings - Fork 243
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
Replace cfor
with fastFor
#1077
Conversation
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <carlos.m.quiroz@gmail.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
…check test Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
Signed-off-by: Carlos Quiroz <3615303+cquiroz@users.noreply.github.com>
This reverts commit 7bf3b7d.
/** | ||
* The `fastFor` macro will replace the `cfor` macro in Scala 3. | ||
* Note that `fastFor` has simpler semantics than `cfor` and in general is _not_ equivalent | ||
* to inlining a while-loop, particularly with respect to closures. | ||
* This change is unlikely to affect typical use-cases, however. | ||
* | ||
* The implementation of `fastFor` provided for Scala 2 is _not_ a macro but is a "reference" implementation | ||
* with semantics matching the Scala 3 macro. | ||
* If you are on Scala 2 and concerned about performance you should continue using `cfor`. | ||
*/ | ||
def fastFor[A](init: A)(test: A => Boolean, next: A => A)(body: A => Unit): Unit = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts?
Oh, I just realized, I didn't think this through. I just replaced all internal uses of |
I did a quick benchmark ...
|
Ok, I created spire-private shims for |
Based against #1067. Opening temporarily for CI before these get merged there.