]> git.wincent.com - wikitext.git/commitdiff
Remove unnecessary string_from_str call in _Wikitext_parser_encode_link_target
authorWincent Colaiuta <win@wincent.com>
Mon, 11 May 2009 20:04:07 +0000 (22:04 +0200)
committerWincent Colaiuta <win@wincent.com>
Mon, 11 May 2009 20:04:07 +0000 (22:04 +0200)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/parser.c

index 09ce8c914e13073e86f2e5b741ee950abaf41177..8681f6c7bf1284db4f2675c239ea814f53cacf4e 100644 (file)
@@ -850,10 +850,9 @@ VALUE Wikitext_parser_sanitize_link_target(VALUE self, VALUE string)
 //         thing. [[Foo]] was...
 static void _Wikitext_parser_encode_link_target(parser_t *parser)
 {
 //         thing. [[Foo]] was...
 static void _Wikitext_parser_encode_link_target(parser_t *parser)
 {
-    VALUE in                = string_from_str(parser->link_target);
-    char        *input      = RSTRING_PTR(in);
+    char        *input      = parser->link_target->ptr;
     char        *start      = input;            // remember this so we can check if we're at the start
     char        *start      = input;            // remember this so we can check if we're at the start
-    long        len         = RSTRING_LEN(in);
+    long        len         = parser->link_target->len;
     if (!(len > 0))
         return;
     char        *end        = input + len;
     if (!(len > 0))
         return;
     char        *end        = input + len;