From 87f55eb03302aaca9caef2342e08768b7bb84709 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 22 Oct 2012 20:45:15 -0700 Subject: [PATCH] Change "3dup drop" to "2over". --- basis/compression/lzw/lzw.factor | 4 ++-- basis/io/timeouts/timeouts.factor | 2 +- basis/persistent/heaps/heaps.factor | 2 +- basis/regexp/dfa/dfa.factor | 2 +- basis/tools/deploy/shaker/shaker.factor | 2 +- core/sets/sets.factor | 2 +- extra/sudoku/sudoku.factor | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/basis/compression/lzw/lzw.factor b/basis/compression/lzw/lzw.factor index 248700b08c..79a8b02e4e 100755 --- a/basis/compression/lzw/lzw.factor +++ b/basis/compression/lzw/lzw.factor @@ -83,8 +83,8 @@ M: gif-lzw increment-code-size [ 1 + 12 min ] change-code-size ; DEFER: handle-clear-code : lzw-process-next-code ( lzw quot: ( lzw code -- ) -- ) [ lzw-read ] dip { - { [ 3dup drop end-of-information? ] [ 3drop ] } - { [ 3dup drop clear-code? ] [ 2drop handle-clear-code ] } + { [ 2over end-of-information? ] [ 3drop ] } + { [ 2over clear-code? ] [ 2drop handle-clear-code ] } [ call( lzw code -- ) ] } cond ; inline diff --git a/basis/io/timeouts/timeouts.factor b/basis/io/timeouts/timeouts.factor index c024e49856..2190b4009d 100644 --- a/basis/io/timeouts/timeouts.factor +++ b/basis/io/timeouts/timeouts.factor @@ -17,7 +17,7 @@ GENERIC: cancel-operation ( obj -- ) [ '[ _ cancel-operation ] ] dip later ; : with-timeout* ( obj timeout quot -- ) - 3dup drop queue-timeout [ nip call ] dip stop-timer ; + 2over queue-timeout [ nip call ] dip stop-timer ; inline : with-timeout ( obj quot -- ) diff --git a/basis/persistent/heaps/heaps.factor b/basis/persistent/heaps/heaps.factor index 38a7eb1313..e836a4afc6 100644 --- a/basis/persistent/heaps/heaps.factor +++ b/basis/persistent/heaps/heaps.factor @@ -37,7 +37,7 @@ PRIVATE> GENERIC: sift-down ( value prio left right -- heap ) : singleton-sift-down ( value prio singleton empty -- heap ) - 3dup drop prio>> <= [ ] [ + 2over prio>> <= [ ] [ drop -rot [ [ value>> ] [ prio>> ] bi ] 2dip ] if ; diff --git a/basis/regexp/dfa/dfa.factor b/basis/regexp/dfa/dfa.factor index 235ff5148f..8ded517c2a 100644 --- a/basis/regexp/dfa/dfa.factor +++ b/basis/regexp/dfa/dfa.factor @@ -43,7 +43,7 @@ IN: regexp.dfa [ tagged-epsilon? not ] filter ; : add-todo-state ( state visited-states new-states -- ) - 3dup drop key? [ 3drop ] [ + 2over key? [ 3drop ] [ [ conjoin ] [ push ] bi-curry* bi ] if ; diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index 75a8f6cbe1..e57ecc631f 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -272,7 +272,7 @@ IN: tools.deploy.shaker _ _ { ! old becomes new - { [ 3dup drop eq? ] [ 2nip ] } + { [ 2over eq? ] [ 2nip ] } ! recurse into arrays { [ pick array? ] [ [ dup ] 2dip recursive-subst ] } ! otherwise do nothing diff --git a/core/sets/sets.factor b/core/sets/sets.factor index 54a2860416..93d880c642 100644 --- a/core/sets/sets.factor +++ b/core/sets/sets.factor @@ -91,7 +91,7 @@ M: set all-unique? drop t ;