Bug 12609 – Useless variable assignment in std.regex

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-04-21T22:17:00Z
Last change time
2014-04-23T09:55:56Z
Keywords
pull
Assigned to
andrej.mitrovich
Creator
briancschott

Comments

Comment #0 by briancschott — 2014-04-21T22:17:39Z
https://github.com/D-Programming-Language/phobos/blob/master/std/regex.d#L5366 The line: startPc = startPc; does nothing and should probably be removed.
Comment #1 by andrej.mitrovich — 2014-04-21T23:12:48Z
This used to be: ----- static if(direction == OneShot.Fwd) startPc = startPc; else startPc = cast(uint)re.ir.length-IRL!(IR.LookbehindEnd); ----- And changed to the current code in commit d9eaf22. My guess is Dmitry probably used some Vim/regex(heh)-style search&replace, and the dead assignment was left in place.
Comment #2 by dmitry.olsh — 2014-04-23T09:55:56Z