]> git.giacomolli.uk - onechat/blobdiff - view_test.go
Fix two comments of the Telegram API and the view
[onechat] / view_test.go
index 39c8e116f5477d8a66f0cdd4c1dcd9c2bb4687ee..56abdd6b81e12e72d0db7ad5a5e72e4b6d5f9537 100644 (file)
@@ -197,7 +197,11 @@ func (p ViewPartTree) Node(level, index int) (Node, bool, error) {
        return treeTestNode(level, index, text), true, nil
 }
 
        return treeTestNode(level, index, text), true, nil
 }
 
-// viewPush is the push of rollback_state_list.js.
+// viewPush adds state to the newest end of states and returns the new list. An
+// empty list gets one entry. When the newest entry is not kept, it becomes kept
+// with its own state, and state is dropped. When it is kept, state becomes a
+// new newest entry, and the state of the old newest entry goes to the older
+// entries by the same push.
 func viewPush(state int, states *ViewPushEntry) *ViewPushEntry {
        if states == nil {
                return &ViewPushEntry{
 func viewPush(state int, states *ViewPushEntry) *ViewPushEntry {
        if states == nil {
                return &ViewPushEntry{