From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.12.99 with SMTP id w96mr38374522ioi.5.1455087648754; Tue, 09 Feb 2016 23:00:48 -0800 (PST) X-Received: by 10.182.153.2 with SMTP id vc2mr578150obb.11.1455087648682; Tue, 09 Feb 2016 23:00:48 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!hb3no2894456igb.0!news-out.google.com!kr2ni12123igb.0!nntp.google.com!hb3no2894445igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 9 Feb 2016 23:00:48 -0800 (PST) In-Reply-To: <2e3f8f3d-9247-4294-9ee7-961547674bc3@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=118.209.28.175; posting-account=l8GBMwoAAADCbqdOJSbg4dBRqkD14dJd NNTP-Posting-Host: 118.209.28.175 References: <2e3f8f3d-9247-4294-9ee7-961547674bc3@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1e9f27cb-18c0-43ed-acb3-4e54ef4d43d0@googlegroups.com> Subject: Re: Quick Sort in Rosetta Code From: Leo Brewin Injection-Date: Wed, 10 Feb 2016 07:00:48 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:29473 Date: 2016-02-09T23:00:48-08:00 List-Id: I bumped inthis problem ages ago. I think the error is that the pair of if statements in the Rosetta code if Left < Item'Last then Left := Index_Type'Succ(Left); end if; if Right > Item'First then Right := Index_Type'Pred(Right); end if; should be merged as a single if statement if Left < Item'Last and Right > Item'First then Left := Index_Type'Succ(Left); Right := Index_Type'Pred(Right); end if; This seems to fix the problem. Cheers, Leo