1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

Use string operations, not idx(), for string indexing.

Summary: Missed this in review (D1715), idx() does not operate on strings (maybe
it does in HPHP/i?).

Test Plan: Faked an editable lint warning, ran "arc lint".

Reviewers: Koolvin, andrewjcg, btrahan

Reviewed By: Koolvin

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1728
This commit is contained in:
epriestley 2012-02-29 08:39:25 -08:00
parent 2fa18d80f8
commit b3a70ac206

View file

@ -160,7 +160,7 @@ final class ArcanistLintRenderer {
if ($message->isPatchable()) {
// Strip trailing newlines, since "explode" will create an extra patch
// line for these.
if (idx($patch, strlen($patch) - 1, null) === "\n") {
if (strlen($patch) && ($patch[strlen($patch) - 1] === "\n")) {
$patch = substr($patch, 0, -1);
}
$patch_lines = explode("\n", $patch);