[systemd-devel] [PATCH] swap: remove if/else with the same data path

Stefan Beller stefanbeller at googlemail.com
Mon Dec 30 14:51:20 PST 2013


This was introduced in e1770af812 (2012-02-03, swap: replace failure
boolean by result enum).

It doesn't do any harm as it most likely will get optimized away anyway,
but maybe for readability?
---
 src/core/swap.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/core/swap.c b/src/core/swap.c
index e0627db..6b204df 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -999,10 +999,7 @@ static void swap_sigchld_event(Unit *u, pid_t pid, int code, int status) {
         case SWAP_DEACTIVATING_SIGKILL:
         case SWAP_DEACTIVATING_SIGTERM:
 
-                if (f == SWAP_SUCCESS)
-                        swap_enter_dead(s, f);
-                else
-                        swap_enter_dead(s, f);
+                swap_enter_dead(s, f);
                 break;
 
         default:
-- 
1.8.5.2.227.g53f3478



More information about the systemd-devel mailing list