diff --git a/src/ring.h b/src/ring.h
index 3efdf2e..6c49b85 100644
--- a/src/ring.h
+++ b/src/ring.h
@@ -43,6 +43,7 @@ #define _vte_ring_delta(__ring) ((__ring
 #define _vte_ring_length(__ring) ((__ring)->length)
 #define _vte_ring_next(__ring) ((__ring)->delta + (__ring)->length)
 #define _vte_ring_max(__ring) ((__ring)->max)
+#ifdef VTE_DEBUG
 #define _vte_ring_at(__ring, __position) \
 	((__ring)->array[__position % (__ring)->max] ? \
 	 (__ring)->array[__position % (__ring)->max] : \
@@ -52,6 +53,10 @@ #define _vte_ring_at(__ring, __position)
 		  (__ring)->delta, (__ring)->length, (__ring)->max, \
 		  (__ring)->delta + (__ring)->length, \
 		  __LINE__), (gpointer) NULL))
+#else
+#define _vte_ring_at(__ring, __position) \
+	((__ring)->array[__position % (__ring)->max])
+#endif
 #define _vte_ring_index(__ring, __cast, __position) \
 	(__cast) _vte_ring_at(__ring, __position)
 
