From 958d54c94426d3c4757cccf5e35320ede3ea39c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 20 Aug 2024 11:11:55 +0200 Subject: [PATCH 1/2] refactor: drop attributes in a more straightforward fashion in `graphlet_basis()` --- R/glet.R | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/R/glet.R b/R/glet.R index cd5432bb2f..a77eb0b857 100644 --- a/R/glet.R +++ b/R/glet.R @@ -118,13 +118,12 @@ graphlet_basis <- function(graph, weights = NULL) { weights <- NULL } - ## Drop all attributes, we don't want to deal with them, TODO - graph2 <- graph - graph2[[igraph_t_idx_attr]] <- list(c(1, 0, 1), list(), list(), list()) + ## Drop all attributes, we don't want to deal with them + graph <- reduce(graph_attr_names(graph), delete_graph_attr, .init = graph) on.exit(.Call(R_igraph_finalizer)) ## Function call - res <- .Call(R_igraph_graphlets_candidate_basis, graph2, weights) + res <- .Call(R_igraph_graphlets_candidate_basis, graph, weights) res } From da9b61129ee70bfc7a641e32a33519bd07cd70b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 20 Aug 2024 14:23:08 +0200 Subject: [PATCH 2/2] refactor: remove the probably useless attribute dropping --- R/glet.R | 3 --- 1 file changed, 3 deletions(-) diff --git a/R/glet.R b/R/glet.R index a77eb0b857..4f460c183a 100644 --- a/R/glet.R +++ b/R/glet.R @@ -118,9 +118,6 @@ graphlet_basis <- function(graph, weights = NULL) { weights <- NULL } - ## Drop all attributes, we don't want to deal with them - graph <- reduce(graph_attr_names(graph), delete_graph_attr, .init = graph) - on.exit(.Call(R_igraph_finalizer)) ## Function call res <- .Call(R_igraph_graphlets_candidate_basis, graph, weights)