Преглед на файлове

use map in comprehension when iterating ingredients

Daniel Sheffield преди 2 години
родител
ревизия
c159fa55e0
променени са 1 файла, в които са добавени 1 реда и са изтрити 5 реда
  1. 1 5
      app/activities/RecipeEditor.py

+ 1 - 5
app/activities/RecipeEditor.py

@@ -269,11 +269,7 @@ class RecipeEditor(FocusWidget):
         yml = dict()
         yml['ingredients'] = list(map(lambda x: ' '.join(x), filter(
             lambda x: None not in map(lambda x: x or None, x), [
-            (
-                x[0].get_edit_text(),
-                x[1].get_text()[0],
-                x[2].get_edit_text(),
-            ) for x in self.ingredients
+                list(map(lambda x: x.get_edit_text(), x)) for x in self.ingredients
         ])))
         serves = self.feeds.value()
         if serves: