changeset 1355:b84f60ebe196

minor fixes
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 17 Apr 2019 01:32:52 -0600
parents 2449ca95dc1e
children 71f067287642
files src/luan/modules/http/tools/Java_threads.luan src/luan/modules/http/tools/Luan_threads.luan src/luan/modules/lucene/Web_search.luan
diffstat 3 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
diff -r 2449ca95dc1e -r b84f60ebe196 src/luan/modules/http/tools/Java_threads.luan
--- a/src/luan/modules/http/tools/Java_threads.luan	Mon Mar 25 16:55:17 2019 -0600
+++ b/src/luan/modules/http/tools/Java_threads.luan	Wed Apr 17 01:32:52 2019 -0600
@@ -2,6 +2,8 @@
 local error = Luan.error
 local Io = require "luan:Io.luan"
 local Time = require "luan:Time.luan"
+local Table = require "luan:Table.luan"
+local to_table = Table.java_to_table_shallow or error()
 local Http = require "luan:http/Http.luan"
 require "java"
 local Thread = require "java:java.lang.Thread"
@@ -14,7 +16,7 @@
 
 	local threads = Thread.getAllStackTraces()
 	local threads = {}
-	for thread, trace in Luan.pairs(Thread.getAllStackTraces()) do
+	for thread, trace in Luan.pairs(to_table(Thread.getAllStackTraces())) do
 		threads[#threads+1] = {
 			trace = trace
 			string = thread.toString()
diff -r 2449ca95dc1e -r b84f60ebe196 src/luan/modules/http/tools/Luan_threads.luan
--- a/src/luan/modules/http/tools/Luan_threads.luan	Mon Mar 25 16:55:17 2019 -0600
+++ b/src/luan/modules/http/tools/Luan_threads.luan	Wed Apr 17 01:32:52 2019 -0600
@@ -4,6 +4,8 @@
 local java_to_table_shallow = Table.java_to_table_shallow or error()
 local Io = require "luan:Io.luan"
 local Time = require "luan:Time.luan"
+local Table = require "luan:Table.luan"
+local to_table = Table.java_to_table_shallow or error()
 local Http = require "luan:http/Http.luan"
 require "java"
 local Thread = require "java:java.lang.Thread"
@@ -17,7 +19,7 @@
 
 	local threads = Thread.getAllStackTraces()
 	local threads = {}
-	for thread, trace in Luan.pairs(Thread.getAllStackTraces()) do
+	for thread, trace in Luan.pairs(to_table(Thread.getAllStackTraces())) do
 		threads[#threads+1] = {
 			trace = trace
 			string = thread.toString()
diff -r 2449ca95dc1e -r b84f60ebe196 src/luan/modules/lucene/Web_search.luan
--- a/src/luan/modules/lucene/Web_search.luan	Mon Mar 25 16:55:17 2019 -0600
+++ b/src/luan/modules/lucene/Web_search.luan	Wed Apr 17 01:32:52 2019 -0600
@@ -173,7 +173,7 @@
 		end
 		local rows = string_to_number(Http.request.parameters.rows)
 		local sort = Http.request.parameters.sort
-		local results = index.search(query,1,rows,sort)
+		local results = index.search(query,1,rows,{sort=sort})
 		local headers = {}
 		local table = {}
 		for _, doc in ipairs(results) do