Skip to content

Commit b538460

Browse files
committed
Remove bin/newlines
Since newlines are working, this bin/newlines is less helpful, and we can remove the API for newlines
1 parent 61e4175 commit b538460

File tree

2 files changed

+0
-58
lines changed

2 files changed

+0
-58
lines changed

bin/newlines

Lines changed: 0 additions & 35 deletions
This file was deleted.

ext/yarp/extension.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -613,28 +613,6 @@ profile_file(VALUE self, VALUE filepath) {
613613
return Qnil;
614614
}
615615

616-
// The function takes a source string and returns a Ruby array containing the
617-
// offsets of every newline in the string. (It also includes a 0 at the
618-
// beginning to indicate the position of the first line.) It accepts a string as
619-
// its only argument and returns an array of integers.
620-
static VALUE
621-
newlines(VALUE self, VALUE string) {
622-
yp_parser_t parser;
623-
size_t length = RSTRING_LEN(string);
624-
yp_parser_init(&parser, RSTRING_PTR(string), length, NULL);
625-
626-
yp_node_t *node = yp_parse(&parser);
627-
yp_node_destroy(&parser, node);
628-
629-
VALUE result = rb_ary_new_capa(parser.newline_list.size);
630-
for (size_t index = 0; index < parser.newline_list.size; index++) {
631-
rb_ary_push(result, INT2FIX(parser.newline_list.offsets[index]));
632-
}
633-
634-
yp_parser_free(&parser);
635-
return result;
636-
}
637-
638616
/******************************************************************************/
639617
/* Initialization of the extension */
640618
/******************************************************************************/
@@ -683,7 +661,6 @@ Init_yarp(void) {
683661
rb_define_singleton_method(rb_cYARP, "unescape_all", unescape_all, 1);
684662
rb_define_singleton_method(rb_cYARP, "memsize", memsize, 1);
685663
rb_define_singleton_method(rb_cYARP, "profile_file", profile_file, 1);
686-
rb_define_singleton_method(rb_cYARP, "newlines", newlines, 1);
687664

688665
// Next, initialize the pack API.
689666
Init_yarp_pack();

0 commit comments

Comments
 (0)