From 27099feb6b3c6d5c41dfe3927c0084ecb6fa50ba Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Fri, 8 Jun 2018 07:19:59 +0200 Subject: [PATCH] glib-2.0: Make Bytes.slice() use the memory-efficient Bytes.from_bytes() Fixes https://gitlab.gnome.org/GNOME/vala/issues/638 --- vapi/glib-2.0.vapi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 65c5bd755..903089c99 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -5053,9 +5053,8 @@ namespace GLib { } [CCode (cname = "_vala_g_bytes_slice")] - public GLib.Bytes slice (int start, int end) { - unowned uint8[] data = this.get_data (); - return new GLib.Bytes (data[start:end]); + public GLib.Bytes slice (size_t start, size_t end) { + return new GLib.Bytes.from_bytes (this, start, end - start); } public int length { -- 2.47.2