From: Rico Tzschichholz Date: Fri, 8 Jun 2018 05:19:59 +0000 (+0200) Subject: glib-2.0: Make Bytes.slice() use the memory-efficient Bytes.from_bytes() X-Git-Tag: 0.41.90~81 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fkeep-around%2F27099feb6b3c6d5c41dfe3927c0084ecb6fa50ba;p=thirdparty%2Fvala.git glib-2.0: Make Bytes.slice() use the memory-efficient Bytes.from_bytes() Fixes https://gitlab.gnome.org/GNOME/vala/issues/638 --- 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 {