diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 19:20:07 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 19:20:07 -0400 |
| commit | 1d2e55f53dfab5153dbfd0c03f28cd9daedb3b77 (patch) | |
| tree | aa1c21191800467abe0b3d16cb6c2a0c2e4587f9 /examples/http-server/http-server.tm | |
| parent | bc93dea8186168aa015b05a615bc1873173393b5 (diff) | |
Allow uninitialized variables when there's a sensible empty value
(defaults to empty/zero value)
Diffstat (limited to 'examples/http-server/http-server.tm')
| -rw-r--r-- | examples/http-server/http-server.tm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/http-server/http-server.tm b/examples/http-server/http-server.tm index b814cdcb..92651ca1 100644 --- a/examples/http-server/http-server.tm +++ b/examples/http-server/http-server.tm @@ -17,7 +17,7 @@ use ./connection-queue.tm func serve(port:Int32, handler:func(request:HTTPRequest -> HTTPResponse), num_threads=16) connections := ConnectionQueue() - workers : &[@pthread_t] = &[] + workers : &[@pthread_t] for i in num_threads workers.insert(pthread_t.new(func() repeat @@ -114,7 +114,7 @@ enum RouteEntry(ServeFile(file:Path), Redirect(destination:Text)) return HTTPResponse("Found", 302, headers={"Location"=destination}) func load_routes(directory:Path -> {Text=RouteEntry}) - routes : &{Text=RouteEntry} = &{} + routes : &{Text=RouteEntry} for file in (directory ++ (./*)).glob() skip unless file.is_file() contents := file.read() or skip |
