[m-rev.] diff: fix performance bug in string__foldl_substring_2

Peter Ross pro at missioncriticalit.com
Tue May 20 22:55:15 AEST 2003


Hi,


===================================================================


Estimated hours taken: 0.25
Branches: main, release

Fix a performance bug in string__foldl_substring_2.

library/string.m:
	We were incorrectly calling string__foldl_substring from
	string__foldl_substring_2 leading to the loss of tail
	recursion in the high level code grades.

Index: library/string.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/string.m,v
retrieving revision 1.199
diff -u -r1.199 string.m
--- library/string.m	14 May 2003 14:38:48 -0000	1.199
+++ library/string.m	20 May 2003 12:27:34 -0000
@@ -732,7 +732,7 @@
 string__foldl_substring_2(Closure, String, I, Count, Acc0, Acc) :-
 	( if 0 < Count then
 		Closure(string__unsafe_index(String, I), Acc0, Acc1),
-		string__foldl_substring(Closure, String, I + 1, Count - 1,
+		string__foldl_substring_2(Closure, String, I + 1, Count - 1,
 			Acc1, Acc)
 	  else
 	  	Acc = Acc0

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list