commit - is there a bug in my rollback system? -


I have a set of unassigned variables and I want to assign the right values ​​to divide and promote the branches. . When the promotion fails, I will return the branch and I will undo the promotion. To undo the spread, I use a comma / rollback system, where multiple rollbacks will break through multiple hacks. I am a bug, am I thinking that I commit to the right time and call rollback? Promotion (), Commit () and Rollback () will not interfere with the assignment array.

  i = 0; While (i> = 0 & amp; amp;; & lt; var.length) {if (assignment [var [i]] == "unassigned") {commit (); Assignment [var [i]] = 1; If (publicity ()) {i ++; } to continue; } If (assignment [var [i]] == 1) {rollback (); Assignment [var [i]] = 0; If (publicity ()) {i ++; } to continue; } // Assignment [var [i]] == 0 assignment [var [i]] = "assigned"; I--; } Anyhow, I think this should work, but on the other hand the bug should be somewhere.   

The code above is correct. I got a bug somewhere else.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -