[gnome-builder] code-index: use g_ptr_array_steal_index()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] code-index: use g_ptr_array_steal_index()
- Date: Tue, 7 Aug 2018 20:20:32 +0000 (UTC)
commit 143e6c7f18c7f45d7003f7763c6f29c4515b2ac4
Author: Christian Hergert <chergert redhat com>
Date: Tue Aug 7 13:07:14 2018 -0700
code-index: use g_ptr_array_steal_index()
We can use this new API in GLib to clean-up some code paths.
meson.build | 2 +-
src/plugins/code-index/ide-code-index-builder.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index c1c946314..1c03a017d 100644
--- a/meson.build
+++ b/meson.build
@@ -249,7 +249,7 @@ message('Linker supports --version-script: @0@'.format(ld_supports_version_scrip
# Commonly used deps
libdazzle_dep = dependency('libdazzle-1.0', version: '>= 3.29.4')
-libgio_dep = dependency('gio-2.0', version: '>= 2.56.0')
+libgio_dep = dependency('gio-2.0', version: '>= 2.57.2')
libgiounix_dep = dependency('gio-unix-2.0')
libgtk_dep = dependency('gtk+-3.0', version: '>= 3.22.26')
libgtksource_dep = dependency('gtksourceview-4', version: '>= 4.0.0')
diff --git a/src/plugins/code-index/ide-code-index-builder.c b/src/plugins/code-index/ide-code-index-builder.c
index 0fd1f2ec4..0dbb4a5eb 100644
--- a/src/plugins/code-index/ide-code-index-builder.c
+++ b/src/plugins/code-index/ide-code-index-builder.c
@@ -1291,8 +1291,7 @@ build_get_build_flags_cb (GObject *object,
g_assert (bd->changes->len > 0);
g_assert (IDE_IS_BUILD_SYSTEM (bd->build_system));
- data_dir = g_object_ref (g_ptr_array_index (bd->changes, bd->changes->len - 1));
- g_ptr_array_remove_index (bd->changes, bd->changes->len - 1);
+ data_dir = g_ptr_array_steal_index (bd->changes, bd->changes->len - 1);
g_assert (G_IS_FILE (data_dir));
if (!(flags = ide_build_system_get_build_flags_for_dir_finish (build_system, result, &error)))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]