Skip to content

Optimization: changed first to first(where:)#3467

Merged
NachoSoto merged 1 commit into
mainfrom
lazy-first-where
Dec 6, 2023
Merged

Optimization: changed first to first(where:)#3467
NachoSoto merged 1 commit into
mainfrom
lazy-first-where

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

See swiftlang/swift#55374

.first has been broken since 2020.

@NachoSoto NachoSoto requested a review from a team November 21, 2023 23:13
.lazy
.compactMap { length in options.first { $0.count == length } }
.first
.first { _ in true } // See https://github.com/apple/swift/issues/55374

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create our own extension firstElement or something like that for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd need to duplicate it in both RevenueCat and RevenueCatUI (since we can't use the package access type yet).

@codecov

codecov Bot commented Nov 22, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.05%. Comparing base (e31a531) to head (28f6d7f).
Report is 433 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3467      +/-   ##
==========================================
- Coverage   86.07%   86.05%   -0.03%     
==========================================
  Files         237      237              
  Lines       17204    17205       +1     
==========================================
- Hits        14809    14806       -3     
- Misses       2395     2399       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NachoSoto NachoSoto merged commit 56daf52 into main Dec 6, 2023
@NachoSoto NachoSoto deleted the lazy-first-where branch December 6, 2023 19:08
NachoSoto pushed a commit that referenced this pull request Dec 12, 2023
**This is an automatic release.**

### RevenueCatUI
* `Paywalls`: improve image caching (#3498) via NachoSoto (@NachoSoto)
* `Paywalls`: change style of CTA button to be consistent with other
platforms (#3507) via NachoSoto (@NachoSoto)
* `Paywalls`: open footer links on Safari on Catalyst (#3508) via
NachoSoto (@NachoSoto)
* `Paywalls`: fix compilation on Xcode < 14.3 (#3513) via NachoSoto
(@NachoSoto)
* Fix typo in zh-Hans localization of RevenueCatUI (#3512) via Francis
Feng (@francisfeng)
* `Paywalls`: fix PaywallViewControllerDelegate access from Objective-C
(#3510) via noncenz (@noncenz)
* `Paywalls`: open Terms and Privacy Policy links in-app (#3475) via
Andy Boedo (@aboedo)
* `Paywalls`: fix empty description when using `custom` package type and
`{{ sub_period }}` (#3495) via Andy Boedo (@aboedo)
* `Paywalls`: use `HEIC` images (#3496) via NachoSoto (@NachoSoto)
* Paywalls: disable the close button when an action is in progress
(#3474) via Andy Boedo (@aboedo)
* `Paywalls`: adjusted German translations (#3476) via Tensei (@tensei)
* Paywalls: Improve Chinese localization (#3489) via Andy Boedo
(@aboedo)
### Other Changes
* `CircleCI`: add git credentials to snapshot generation (#3506) via
NachoSoto (@NachoSoto)
* `StoreProduct`: improve `priceFormatter` documentation (#3500) via
NachoSoto (@NachoSoto)
* `Paywalls`: fix tests (#3499) via NachoSoto (@NachoSoto)
* `Optimization`: changed `first` to `first(where:)` (#3467) via
NachoSoto (@NachoSoto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants