in reply to Determine new line number in revised file given old line number
patch:
- $new_to_old[$_] += ( $4 ? $4 : $5 ) - $5 + $2 - ( $1 : $1 ? $2 ) + ( + $3 cmp 'c' ) + $new_to_old[$_] += ( $4 ? $4 : $5 ) - $5 + $2 - ( $1 ? $1 : $2 ) + ( + $3 cmp 'c' )
It seems a little convoluted.
For starters, to remove a bit convolutedness, I'd drop that ternary constructs and rewrite that line as
$new_to_old[$_] += ( $4 || $5 ) - $5 + $2 - ( $1 || $2 ) + ( $3 cmp 'c +' )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Determine new line number in revised file given old line number
by ExReg (Priest) on Mar 29, 2017 at 19:49 UTC |