From 729ffd0e91fe8f6836cea03fc21689619c44ab55 Mon Sep 17 00:00:00 2001
From: Konstantin Osipov <kostja.osipov@gmail.com>
Date: Wed, 14 Sep 2011 15:38:50 +0400
Subject: [PATCH] Lua: animate box.space[], code review.

Print userdata for index in a non-suggestive, but
informative way.
---
 mod/box/box_lua.m   | 4 ++--
 test/box/lua.result | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mod/box/box_lua.m b/mod/box/box_lua.m
index c1faca4180..a2e361eb21 100644
--- a/mod/box/box_lua.m
+++ b/mod/box/box_lua.m
@@ -174,8 +174,8 @@ static int
 lbox_index_tostring(struct lua_State *L)
 {
 	struct index *index = lua_checkindex(L, 1);
-	lua_pushfstring(L, "box.space[%d].index[%d]",
-			index->space->n, index->n);
+	lua_pushfstring(L, "index %d in space %d",
+			index->n, index->space->n);
 	return 1;
 }
 
diff --git a/test/box/lua.result b/test/box/lua.result
index 389af7efd8..b3ce285158 100644
--- a/test/box/lua.result
+++ b/test/box/lua.result
@@ -415,7 +415,7 @@ error: 'No index #1 is defined in space 0'
 ...
 lua box.index.new(0, 0)
 ---
- - box.space[0].index[0]
+ - index 0 in space 0
 ...
 lua #box.index.new(0,0)
 ---
-- 
GitLab