comparison src/org/tmatesoft/hg/internal/IntVector.java @ 561:d3c71498919c

Do not process child revisions before all possible parent paths were visited
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 27 Feb 2013 19:37:58 +0100
parents 45751456b471
children e49f9d9513fa
comparison
equal deleted inserted replaced
560:52263817b998 561:d3c71498919c
13 * For information on how to redistribute this software under 13 * For information on how to redistribute this software under
14 * the terms of a license other than GNU General Public License 14 * the terms of a license other than GNU General Public License
15 * contact TMate Software at support@hg4j.com 15 * contact TMate Software at support@hg4j.com
16 */ 16 */
17 package org.tmatesoft.hg.internal; 17 package org.tmatesoft.hg.internal;
18
19 import java.util.Arrays;
18 20
19 /** 21 /**
20 * Vector of primitive values 22 * Vector of primitive values
21 * 23 *
22 * @author Artem Tikhomirov 24 * @author Artem Tikhomirov
99 data[b] = data[a]; 101 data[b] = data[a];
100 data[a] = t; 102 data[a] = t;
101 } 103 }
102 } 104 }
103 105
106 /**
107 *
108 * @param ascending <code>true</code> to sort in ascending order, <code>false</code> for descending
109 */
110 public void sort(boolean ascending) {
111 Arrays.sort(data, 0, count);
112 if (!ascending) {
113 reverse();
114 }
115 }
116
117
104 @Override 118 @Override
105 public String toString() { 119 public String toString() {
106 return String.format("%s[%d]", IntVector.class.getSimpleName(), size()); 120 return String.format("%s[%d]", IntVector.class.getSimpleName(), size());
107 } 121 }
108 122