Committed by
Jonathan Hart
Avoid empty check of BatchWrite in the caller side
Change-Id: I5672b2d6fab719ab9a5c642a942bf4a6191e808d
Showing
1 changed file
with
2 additions
and
4 deletions
... | @@ -1151,7 +1151,7 @@ public class IntentManager | ... | @@ -1151,7 +1151,7 @@ public class IntentManager |
1151 | 1151 | ||
1152 | // Write batch information | 1152 | // Write batch information |
1153 | BatchWrite batchWrite = createBatchWrite(updates); | 1153 | BatchWrite batchWrite = createBatchWrite(updates); |
1154 | - writeBatch(batchWrite); | 1154 | + store.batchWrite(batchWrite); |
1155 | 1155 | ||
1156 | new IntentBatchApplyFirst(ops, processIntentUpdates(updates), endTime, 0, null).run(); | 1156 | new IntentBatchApplyFirst(ops, processIntentUpdates(updates), endTime, 0, null).run(); |
1157 | } catch (Exception e) { | 1157 | } catch (Exception e) { |
... | @@ -1200,11 +1200,9 @@ public class IntentManager | ... | @@ -1200,11 +1200,9 @@ public class IntentManager |
1200 | } | 1200 | } |
1201 | 1201 | ||
1202 | protected void writeBatch(BatchWrite batchWrite) { | 1202 | protected void writeBatch(BatchWrite batchWrite) { |
1203 | - if (!batchWrite.isEmpty()) { | ||
1204 | store.batchWrite(batchWrite); | 1203 | store.batchWrite(batchWrite); |
1205 | } | 1204 | } |
1206 | } | 1205 | } |
1207 | - } | ||
1208 | 1206 | ||
1209 | // TODO: better naming | 1207 | // TODO: better naming |
1210 | private class IntentBatchApplyFirst extends IntentBatchPreprocess { | 1208 | private class IntentBatchApplyFirst extends IntentBatchPreprocess { |
... | @@ -1242,7 +1240,7 @@ public class IntentManager | ... | @@ -1242,7 +1240,7 @@ public class IntentManager |
1242 | // there are no flow rule batches; finalize the intent update | 1240 | // there are no flow rule batches; finalize the intent update |
1243 | BatchWrite batchWrite = createFinalizedBatchWrite(updates); | 1241 | BatchWrite batchWrite = createFinalizedBatchWrite(updates); |
1244 | 1242 | ||
1245 | - writeBatch(batchWrite); | 1243 | + store.batchWrite(batchWrite); |
1246 | return null; | 1244 | return null; |
1247 | } | 1245 | } |
1248 | } | 1246 | } | ... | ... |
-
Please register or login to post a comment