remove unecessary code in linediff()
[diff2html.git] / diff2html.py
index 337667f..3e52700 100644 (file)
@@ -106,7 +106,6 @@ def linediff(s, t):
 
     m, n = len(s), len(t)
     d = [[(0, 0) for i in range(n+1)] for i in range(m+1)]
-    x = [[(0, 0) for i in range(n+1)] for i in range(m+1)]
 
 
     d[0][0] = (0, (0, 0))
@@ -424,9 +423,11 @@ def main():
 
 def parse_from_memory(txt, exclude_headers, show_hunk_infos):
     " Parses diff from memory and returns a string with html "
-    stream = StringIO.StringIO(txt)
-    parse_input(stream, stream, exclude_headers, show_hunk_infos)
-    return stream.buf
+    input_stream = StringIO.StringIO(txt)
+    output_stream = StringIO.StringIO()
+    parse_input(input_stream, output_stream, exclude_headers, show_hunk_infos)
+    return output_stream.getvalue()
+
 
 if __name__ == "__main__":
     main()