Commit 780e79f6 authored by Jürg Billeter's avatar Jürg Billeter
Browse files

Update code using deprecated # modifier or operator

parent ea232056
......@@ -2,7 +2,7 @@
*
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 1997-2000 GLib Team and others
* Copyright (C) 2007-2008 Jürg Billeter
* Copyright (C) 2007-2009 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -129,12 +129,12 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
public void clear () {
for (int i = 0; i < _array_size; i++) {
Node<K,V> node = #_nodes[i];
Node<K,V> node = (owned) _nodes[i];
while (node != null) {
Node next = #node.next;
Node next = (owned) node.next;
node.key = null;
node.value = null;
node = #next;
node = (owned) next;
}
}
_nnodes = 0;
......@@ -152,14 +152,14 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
for (int i = 0; i < _array_size; i++) {
Node<K,V> node;
Node<K,V> next;
for (node = #_nodes[i]; node != null; node = #next) {
next = #node.next;
for (node = (owned) _nodes[i]; node != null; node = (owned) next) {
next = (owned) node.next;
uint hash_val = node.key_hash % new_array_size;
node.next = #new_nodes[hash_val];
new_nodes[hash_val] = #node;
node.next = (owned) new_nodes[hash_val];
new_nodes[hash_val] = (owned) node;
}
}
_nodes = #new_nodes;
_nodes = (owned) new_nodes;
_array_size = new_array_size;
}
}
......@@ -175,9 +175,9 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
public Node<K,V> next;
public uint key_hash;
public Node (K# k, V# v, uint hash) {
key = #k;
value = #v;
public Node (owned K k, owned V v, uint hash) {
key = (owned) k;
value = (owned) v;
key_hash = hash;
}
}
......
......@@ -2,7 +2,7 @@
*
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 1997-2000 GLib Team and others
* Copyright (C) 2007-2008 Jürg Billeter
* Copyright (C) 2007-2009 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -114,11 +114,11 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
public void clear () {
for (int i = 0; i < _array_size; i++) {
Node<G> node = #_nodes[i];
Node<G> node = (owned) _nodes[i];
while (node != null) {
Node next = #node.next;
Node next = (owned) node.next;
node.key = null;
node = #next;
node = (owned) next;
}
}
_nnodes = 0;
......@@ -136,14 +136,14 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
for (int i = 0; i < _array_size; i++) {
Node<G> node;
Node<G> next;
for (node = #_nodes[i]; node != null; node = #next) {
next = #node.next;
for (node = (owned) _nodes[i]; node != null; node = (owned) next) {
next = (owned) node.next;
uint hash_val = node.key_hash % new_array_size;
node.next = #new_nodes[hash_val];
new_nodes[hash_val] = #node;
node.next = (owned) new_nodes[hash_val];
new_nodes[hash_val] = (owned) node;
}
}
_nodes = #new_nodes;
_nodes = (owned) new_nodes;
_array_size = new_array_size;
}
}
......@@ -158,8 +158,8 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
public Node<G> next;
public uint key_hash;
public Node (G# k, uint hash) {
key = #k;
public Node (owned G k, uint hash) {
key = (owned) k;
key_hash = hash;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment