cleanup
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 3 Jan 2026 17:33:00 +0000 (09:33 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 3 Jan 2026 17:33:00 +0000 (09:33 -0800)
rust/pspp/src/spv/read/legacy_xml.rs

index 790726042adf342b8e76e9b032f98300c063761d..ebb53f3d373387be619d382783f48349c58d8bed 100644 (file)
@@ -771,22 +771,18 @@ impl Series {
     fn with_affixes(self, affixes: Vec<Affix>) -> Self {
         Self { affixes, ..self }
     }
-    fn add_affixes(&self, mut value: Value, footnotes: &pivot::Footnotes) -> Value {
+
+    fn new_name(&self, dv: &DataValue, footnotes: &pivot::Footnotes) -> Value {
+        let mut name = Value::new_datum(self.map.lookup(dv));
         for affix in &self.affixes {
             if let Some(index) = affix.defines_reference.checked_sub(1)
                 && let Ok(index) = usize::try_from(index)
                 && let Some(footnote) = footnotes.get(index)
             {
-                value.add_footnote(footnote);
+                name.add_footnote(footnote);
             }
         }
-        value
-    }
-
-    fn new_name(&self, dv: &DataValue, footnotes: &pivot::Footnotes) -> Value {
-        let dv = self.map.lookup(dv);
-        let name = Value::new_datum(dv);
-        self.add_affixes(name, &footnotes)
+        name
     }
 }