Skip to content

Commit f9a09f7

Browse files
Mingshen Sunmssun
authored andcommitted
rpython/rtyper/rlist: remve unneccessary commented code
1 parent 3dce1ee commit f9a09f7

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

rpython/rtyper/rlist.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ def rtype_contains((r_lst, _), hop):
265265
class __extend__(pairtype(AbstractBaseListRepr, IntegerRepr)):
266266

267267
def rtype_getitem((r_lst, r_int), hop, checkidx=False):
268-
# ll_assert(hop.unsafe == False, "unsafe is true")
269268
v_lst, v_index = hop.inputargs(r_lst, Signed)
270269
if checkidx:
271270
hop.exception_is_here()
@@ -706,9 +705,6 @@ def ll_pop_nonneg(func, l, index):
706705
ll_pop_nonneg.oopspec = 'list.pop(l, index)'
707706

708707
def ll_pop_nonneg_unsafe(func, l, index):
709-
# if func is dum_checkidx:
710-
# if index >= l.ll_length():
711-
# raise IndexError
712708
res = l.ll_getitem_fast_unsafe(index)
713709
ll_delitem_nonneg_unsafe(dum_nocheck, l, index)
714710
return res
@@ -730,8 +726,6 @@ def ll_pop_default(func, l):
730726

731727
def ll_pop_default_unsafe(func, l):
732728
length = l.ll_length()
733-
# if func is dum_checkidx and (length == 0):
734-
# raise IndexError
735729
index = length - 1
736730
newlength = index
737731
res = l.ll_getitem_fast_unsafe(index)
@@ -763,8 +757,6 @@ def ll_pop_zero(func, l):
763757

764758
def ll_pop_zero_unsafe(func, l):
765759
length = l.ll_length()
766-
# if func is dum_checkidx and (length == 0):
767-
# raise IndexError
768760
newlength = length - 1
769761
res = l.ll_getitem_fast_unsafe(0)
770762
j = 0
@@ -798,9 +790,6 @@ def ll_pop_unsafe(func, l, index):
798790
length = l.ll_length()
799791
if index < 0:
800792
index += length
801-
# if func is dum_checkidx:
802-
# if index < 0 or index >= length:
803-
# raise IndexError
804793
res = l.ll_getitem_fast_unsafe(index)
805794
ll_delitem_nonneg_unsafe(dum_nocheck, l, index)
806795
return res
@@ -839,9 +828,6 @@ def ll_getitem_nonneg(func, basegetitem, l, index):
839828
# no oopspec -- the function is inlined by the JIT
840829

841830
def ll_getitem_nonneg_unsafe(func, basegetitem, l, index):
842-
# if func is dum_checkidx:
843-
# if index >= l.ll_length():
844-
# raise IndexError
845831
return basegetitem(l, index)
846832
ll_getitem_nonneg_unsafe._always_inline_ = True
847833
# no oopspec -- the function is inlined by the JIT
@@ -867,16 +853,6 @@ def ll_getitem(func, basegetitem, l, index):
867853
# no oopspec -- the function is inlined by the JIT
868854

869855
def ll_getitem_unsafe(func, basegetitem, l, index):
870-
# if func is dum_checkidx:
871-
# length = l.ll_length() # common case: 0 <= index < length
872-
# if r_uint(index) >= r_uint(length):
873-
# # Failed, so either (-length <= index < 0), or we have to raise
874-
# # IndexError. First add 'length' to get the final index, then
875-
# # check that we now have (0 <= index < length).
876-
# index = r_uint(index) + r_uint(length)
877-
# if index >= r_uint(length):
878-
# raise IndexError
879-
# index = intmask(index)
880856
return basegetitem(l, index)
881857
# no oopspec -- the function is inlined by the JIT
882858

@@ -907,9 +883,6 @@ def ll_setitem_nonneg(func, l, index, newitem):
907883
# no oopspec -- the function is inlined by the JIT
908884

909885
def ll_setitem_nonneg_unsafe(func, l, index, newitem):
910-
# if func is dum_checkidx:
911-
# if index >= l.ll_length():
912-
# raise IndexError
913886
l.ll_setitem_fast_unsafe(index, newitem)
914887
ll_setitem_nonneg_unsafe._always_inline_ = True
915888
# no oopspec -- the function is inlined by the JIT
@@ -930,13 +903,6 @@ def ll_setitem(func, l, index, newitem):
930903
# no oopspec -- the function is inlined by the JIT
931904

932905
def ll_setitem_unsafe(func, l, index, newitem):
933-
# if func is dum_checkidx:
934-
# length = l.ll_length()
935-
# if r_uint(index) >= r_uint(length): # see comments in ll_getitem().
936-
# index = r_uint(index) + r_uint(length)
937-
# if index >= r_uint(length):
938-
# raise IndexError
939-
# index = intmask(index)
940906
l.ll_setitem_fast_unsafe(index, newitem)
941907
# no oopspec -- the function is inlined by the JIT
942908

@@ -966,9 +932,6 @@ def ll_delitem_nonneg(func, l, index):
966932
@enforceargs(None, None, int)
967933
def ll_delitem_nonneg_unsafe(func, l, index):
968934
length = l.ll_length()
969-
# if func is dum_checkidx:
970-
# if index >= length:
971-
# raise IndexError
972935
newlength = length - 1
973936
j = index
974937
j1 = j+1
@@ -999,13 +962,6 @@ def ll_delitem(func, l, index):
999962
# no oopspec -- the function is inlined by the JIT
1000963

1001964
def ll_delitem_unsafe(func, l, index):
1002-
# if func is dum_checkidx:
1003-
# length = l.ll_length()
1004-
# if r_uint(index) >= r_uint(length): # see comments in ll_getitem().
1005-
# index = r_uint(index) + r_uint(length)
1006-
# if index >= r_uint(length):
1007-
# raise IndexError
1008-
# index = intmask(index)
1009965
ll_delitem_nonneg_unsafe(dum_nocheck, l, index)
1010966
# no oopspec -- the function is inlined by the JIT
1011967

0 commit comments

Comments
 (0)