Cleanup: usages of bt_value_array_borrow_element_by_index{,_const}()
[babeltrace.git] / src / plugins / ctf / lttng-live / viewer-connection.c
index 53358131fe9b9f0a707b0f27c4c1588ecd050627..e8af3771b83c767929dfef58957551184a32ed85 100644 (file)
@@ -304,7 +304,8 @@ int list_update_session(bt_value *results,
                const struct lttng_viewer_session *session,
                bool *_found, struct live_viewer_connection *viewer_connection)
 {
-       int i, len, ret = 0;
+       int ret = 0;
+       uint64_t i, len;
        bt_value *map = NULL;
        bt_value *hostname = NULL;
        bt_value *session_name = NULL;
@@ -312,21 +313,11 @@ int list_update_session(bt_value *results,
        bool found = false;
 
        len = bt_value_array_get_length(results);
-       if (len < 0) {
-               BT_COMP_LOGE_STR("Error getting size of array.");
-               ret = -1;
-               goto end;
-       }
        for (i = 0; i < len; i++) {
                const char *hostname_str = NULL;
                const char *session_name_str = NULL;
 
-               map = bt_value_array_borrow_element_by_index(results, (size_t) i);
-               if (!map) {
-                       BT_COMP_LOGE_STR("Error borrowing map.");
-                       ret = -1;
-                       goto end;
-               }
+               map = bt_value_array_borrow_element_by_index(results, i);
                hostname = bt_value_map_borrow_entry_value(map, "target-hostname");
                if (!hostname) {
                        BT_COMP_LOGE_STR("Error borrowing \"target-hostname\" entry.");
This page took 0.0241 seconds and 4 git commands to generate.