Merge: Ropes
authorJean Privat <jean@pryen.org>
Thu, 6 Nov 2014 23:00:22 +0000 (18:00 -0500)
committerJean Privat <jean@pryen.org>
Thu, 6 Nov 2014 23:00:22 +0000 (18:00 -0500)
Here they are, after a few months hiding in the fiery depths of the dumpsterâ„¢, they return, once more.

The Ropes are back, and they're looking for trouble.

On a more serious note, they look a lot more performing than before, thanks to a wrapper-less structure.

The code is also simpler to read and understand (and there's lots more of documentation, I figured @Morriar would like that).

Finally, you can use Strings in a transparent way, never to create Ropes on your own, now the library does it for you.

Furthermore, `RopeBuffer` pridefully returns with the promises of crushing the `FlatBuffer` when concatenating stuff and resisting a bit more to longer strings.
(NDLR: Single-character modifications will be slow.)

Pull-Request: #829
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

1  2 
lib/standard/string.nit
src/doc/doc_pages.nit

Simple merge
@@@ -992,8 -1009,8 +992,8 @@@ class NitdocModul
                        end
                end
                # build graph
-               var op = new FlatBuffer
+               var op = new RopeBuffer
 -              var name = "dep_{mmodule.name}"
 +              var name = "dep_module_{mmodule.nitdoc_id}"
                op.append("digraph {name} \{ rankdir=BT; node[shape=none,margin=0,width=0,height=0,fontsize=10]; edge[dir=none,color=gray]; ranksep=0.2; nodesep=0.1;\n")
                for mmodule in poset do
                        if mmodule == self.mmodule then
@@@ -1373,8 -1392,8 +1373,8 @@@ class NitdocClas
                        end
                end
  
-               var op = new FlatBuffer
+               var op = new RopeBuffer
 -              var name = "dep_{mclass.name}"
 +              var name = "dep_class_{mclass.nitdoc_id}"
                op.append("digraph {name} \{ rankdir=BT; node[shape=none,margin=0,width=0,height=0,fontsize=10]; edge[dir=none,color=gray]; ranksep=0.2; nodesep=0.1;\n")
                var classes = poset.to_a
                var todo = new Array[MClass]