internal-reduce extended on StringSeq calls `.length` on every iteration step

Description

internal-reduce extended on StringSeq calls `.length` (on the same String object) upon every iteration step [1]. There is absolutely no need for this as the length of a String cannot change. Therefore, it can be bound once (in the `let` a couple of lines up) and used thereafter.

[1]: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/protocols.clj#L151

Prescreened by: Alex Miller
Patch: clj-1917-2.patch

Environment

n/a

Activity

Show:
Jozef Wagner
December 1, 2016, 8:00 PM

Patch attached

Rich Hickey
September 6, 2017, 3:21 PM

no variable should ever be called l

Alex Miller
September 6, 2017, 3:26 PM

Updated patch to use len instead of l.

Completed

Assignee

Unassigned

Reporter

Dimitrios Jim Piliouras

Labels

Approval

Ok

Patch

Code

Fix versions

Affects versions

Priority

Minor
Configure