Skip to content

Commit c14f0cb

Browse files
committed
Unify n==0 and n==1 cases, remove debug println
1 parent 9249548 commit c14f0cb

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

crates/famst/src/lib.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,7 @@ where
158158
R: Rng,
159159
{
160160
let n = data.len();
161-
if n == 0 {
162-
return FamstResult {
163-
edges: vec![],
164-
total_weight: 0.0,
165-
};
166-
}
167-
if n == 1 {
161+
if n <= 1 {
168162
return FamstResult {
169163
edges: vec![],
170164
total_weight: 0.0,
@@ -178,7 +172,6 @@ where
178172
let (undirected_graph, components) = find_components(&ann_graph);
179173

180174
// If only one component, skip inter-component edge logic
181-
println!("components {}", components.len());
182175
if components.len() <= 1 {
183176
let edges = extract_mst_from_ann(&ann_graph, n);
184177
let total_weight = edges.iter().map(|e| e.distance).sum();

0 commit comments

Comments
 (0)