Commit Graph

15 Commits

Author SHA1 Message Date
JP Simard b83e0991b9 Remove all file headers
The MIT license doesn't require that all files be prepended with this
licensing or copyright information. Realm confirmed that they're ok with this
change. This will enable some companies to contribute to SwiftLint and the
date & authorship information will remain accessible via git source control.
2018-05-04 13:42:02 -07:00
Norio Nomura 2a0ac455bc 'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-04-08 13:28:09 +09:00
Norio Nomura 85542a6f8d Remove DispatchQueue.sync from Array.parallelMap
`DispatchQueue.sync` was required to avoid CoW on calling `subscript` from multiple copied instances of `Array`.
Since `UnsafeMutableBufferPointer` does not cause CoW on same situation, `DispatchQueue.sync` can be removed.
2018-03-08 15:56:28 +09:00
JP Simard a7a8a69fa2 Improve Array.parallelMap
By applying concepts from Swift Talk 90: https://talk.objc.io/episodes/S01E90-concurrent-map

Notably:
* Removing `@escaping` from block parameter
* Avoiding Array.append & sorting
* Using a constant DispatchQueue label
2018-03-07 09:27:35 -08:00
Marcelo Fabri d9eda655bf PR feedback 2017-01-02 17:49:54 -02:00
JP Simard 53d0cf6975 fix incorrect flatMap usage to use map instead 2017-01-02 09:47:48 -08:00
JP Simard 8774a921a6 use DispatchQueue.concurrentPerform rather than rolling our own
also remove parallelForEach from SwiftLintFramework's public interface
since calling the GCD API is almost as concise and avoids polluting the
public API.

Finally, also remove the "fast" path for parallelMap since GCD should
do the reasonable thing for us here.
2016-12-31 17:06:02 -08:00
JP Simard 28813fce08 extend Array with parallelMap, parallelFlatMap and parallelForEach 2016-12-30 23:08:23 -08:00
JP Simard a50a0bee06 move array(of:) into other unconstrained Array extension 2016-12-30 18:21:11 -08:00
JP Simard b409a056e5 refactor Array.unique and Array.group(by:) 2016-12-07 23:26:43 -08:00
Michał Kałużny d97632e52d Add human readable reporter that’s also funny because emoji. 2016-12-07 23:13:59 -08:00
JP Simard 0b481f1e16 change Array.arrayOf(_:) to Array.array(of:) 2016-12-01 18:09:38 -08:00
Norio Nomura 8bf15f1dba Migrate to Swift 3.0 2016-10-09 01:09:50 +09:00
Scott Hoyt 0ee04c3fa3 Added exclusion pattern for matching patterns in a file. Added Array and NSRange extensions to support. Used this in OpeningBraceRule. 2016-02-02 17:15:00 -08:00
Scott Hoyt 647371517e Extracted arrayOf to Array extension and used to simplify VariableNameMinLengthRule.init?(config:). 2016-01-11 13:10:17 -08:00