Created
August 21, 2012 09:01
-
-
Save barttenbrinke/3413754 to your computer and use it in GitHub Desktop.
Tr fix?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vm/builtin/string.cpp b/vm/builtin/string.cpp | |
index 49e5628..52e7848 100644 | |
--- a/vm/builtin/string.cpp | |
+++ b/vm/builtin/string.cpp | |
@@ -944,20 +944,9 @@ namespace rubinius { | |
native_int limit; | |
bool assign(native_int chr) { | |
- int j, i = set[chr]; | |
- | |
if(limit >= 0 && steps >= limit) return true; | |
- if(i < 0) { | |
- tr[last] = chr; | |
- } else { | |
- last--; | |
- for(j = i + 1; j <= last; j++) { | |
- set[tr[j]]--; | |
- tr[j-1] = tr[j]; | |
- } | |
- tr[last] = chr; | |
- } | |
+ tr[last] = chr; | |
set[chr] = last++; | |
steps++; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment