summaryrefslogtreecommitdiff
path: root/boil/library/TypeFactory.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-17 20:47:59 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-17 20:47:59 -0600
commita2629207350dbad42251431e58bace2ff333d613 (patch)
treeea3b6394d130ff5dcf8bf9ae13719496bb9b7e81 /boil/library/TypeFactory.java
parentbb87a9b63707d171eb105b8d66fe9109f8e540e4 (diff)
Fix bugs in dereferencing, minor code cleanup
Diffstat (limited to 'boil/library/TypeFactory.java')
-rw-r--r--boil/library/TypeFactory.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/boil/library/TypeFactory.java b/boil/library/TypeFactory.java
index 8c64101..93966f0 100644
--- a/boil/library/TypeFactory.java
+++ b/boil/library/TypeFactory.java
@@ -32,11 +32,13 @@ public class TypeFactory {
* list of the x most recent entries.
*/
String rtn = "";
- rtn += String.format("t.%d",
- type_num-x);
- for (int i = type_num-(x-1); i < type_num; ++i) {
- rtn += String.format(" t.%d",
- i);
+ if (x > 0) {
+ rtn += String.format("t.%d",
+ type_num-x);
+ for (int i = type_num-(x-1); i < type_num; ++i) {
+ rtn += String.format(" t.%d",
+ i);
+ }
}
return rtn;