소스 검색

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: