Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Core] Add a new method to get a string->string hash instance. Rename…

… other hash creator methods to indicate the key/value types.
  • Loading branch information...
commit eb5288df82a1ec4aaf91e7e9c873c1539cc0c442 1 parent 1ae219c
@Whiteknight authored
View
16 src/core/Hash.winxed
@@ -1,13 +1,25 @@
namespace Rosella
{
// Get a PMC-keyed hash
- function get_pmc_keyed_hash()
+ function get_pmc_pmc_hash()
{
return pmc_keyed_hash();
}
- function get_int_keyed_hash()
+ function get_int_pmc_hash()
{
return int_keyed_hash();
}
+
+ function get_string_pmc_hash()
+ {
+ return {};
+ }
+
+ function get_string_string_hash()
+ {
+ var h = {};
+ h.set_value_type(DATATYPE_STRING);
+ return h;
+ }
}
View
2  src/core/Includes.winxed
@@ -1 +1 @@
-
+$include_const "datatypes.pasm";
View
4 src/core/StringFormatter.winxed
@@ -11,8 +11,8 @@ namespace Rosella.StringFormatter
// Get a hash of type-specific formatters
function type_formatters()
{
- using Rosella.get_pmc_keyed_hash;
- return Rosella.Globals.autoget_global(TYPE_FORMATTERS, get_pmc_keyed_hash);
+ using Rosella.get_pmc_pmc_hash;
+ return Rosella.Globals.autoget_global(TYPE_FORMATTERS, get_pmc_pmc_hash);
}
// Register a new formatter object for a specific type
View
2  src/query/iterable/Iterators.winxed
@@ -562,7 +562,7 @@ class Rosella.Query.Iterable.GroupBy : Rosella.Query.Iterable
if (!self.source.has_more())
self.__empty();
var f = self.func;
- var groups = Rosella.pmc_keyed_hash();
+ var groups = pmc_keyed_hash();
:(var d, int m) = self.next_and_more();
var key = f(d);
groups[key] = [d];
View
3  src/unstable/net/http/Header.winxed
@@ -4,8 +4,7 @@ class Rosella.Net.Http.Header
function Header()
{
- self.values = {};
- // TODO: Set hash value to be strings to avoid boxing
+ self.values = Rosella.get_string_string_hash();
}
function add_value(string name, string value)
Please sign in to comment.
Something went wrong with that request. Please try again.