Optimize RemoveConsecutiveChars.
Optimize RemoveConsecutiveChars.

New code is in O(n) instead of O(n2) and avoid unnecessary temporary strings.

BUG=

Review URL: https://codereview.chromium.org/1488243002

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#362728}

axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk