Patchwork [1,of,7] bdiff: drop support for array.array argument from pure.bdiff.bdiff()

login
register
mail settings
Submitter Yuya Nishihara
Date March 26, 2017, 11:59 a.m.
Message ID <3bb6534a49672073885c.1490529584@mimosa>
Download mbox | patch
Permalink /patch/19678/
State Accepted
Headers show

Comments

Yuya Nishihara - March 26, 2017, 11:59 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1490512444 -32400
#      Sun Mar 26 16:14:04 2017 +0900
# Node ID 3bb6534a49672073885c64a7a75a8ef5bb26f381
# Parent  c60091fa1426892552dd6c0dd4b9c49e3c3da045
bdiff: drop support for array.array argument from pure.bdiff.bdiff()

Thanks to 2a18e9e6ca43, we no longer pass array.array('c') object to
bdiff().

Patch

diff --git a/mercurial/pure/bdiff.py b/mercurial/pure/bdiff.py
--- a/mercurial/pure/bdiff.py
+++ b/mercurial/pure/bdiff.py
@@ -7,7 +7,6 @@ 
 
 from __future__ import absolute_import
 
-import array
 import difflib
 import re
 import struct
@@ -56,9 +55,6 @@  def _normalizeblocks(a, b, blocks):
     return r
 
 def _tostring(c):
-    if type(c) is array.array:
-        # this copy overhead isn't ideal
-        return c.tostring()
     return str(c)
 
 def bdiff(a, b):