Remove unused alias for wbo/identity.

This commit is contained in:
Edward Lee 2009-08-25 08:52:52 -07:00
Родитель 8733edea53
Коммит e355170c90
2 изменённых файлов: 2 добавлений и 34 удалений

Просмотреть файл

@ -126,7 +126,6 @@ RecordManager.prototype = {
_init: function RegordMgr__init() {
this._log = Log4Moz.repository.getLogger(this._logName);
this._records = {};
this._aliases = {};
},
import: function RecordMgr_import(url) {
@ -148,17 +147,10 @@ RecordManager.prototype = {
},
get: function RecordMgr_get(url) {
// Note: using url object directly as key for this._records cache does not
// work because different url objects (even pointing to the same place) are
// different objects and therefore not equal. So always use the string, not
// the object, as a key.
// TODO: use the string as key for this._aliases as well? (Don't know)
// Use a url string as the key to the hash
let spec = url.spec ? url.spec : url;
if (spec in this._records)
return this._records[spec];
if (url in this._aliases)
url = this._aliases[url];
return this.import(url);
},
@ -168,10 +160,7 @@ RecordManager.prototype = {
},
contains: function RegordMgr_contains(url) {
let record = null;
if (url in this._aliases)
url = this._aliases[url];
if (url in this._records)
if ((url.spec || url) in this._records)
return true;
return false;
},
@ -182,14 +171,5 @@ RecordManager.prototype = {
del: function RegordMgr_del(url) {
delete this._records[url];
},
getAlias: function RegordMgr_getAlias(alias) {
return this._aliases[alias];
},
setAlias: function RegordMgr_setAlias(url, alias) {
this._aliases[alias] = url;
},
delAlias: function RegordMgr_delAlias(alias) {
delete this._aliases[alias];
}
};

Просмотреть файл

@ -51,12 +51,9 @@ Utils.lazy(this, 'ID', IDManager);
// For storing identities we'll use throughout Weave
function IDManager() {
this._ids = {};
this._aliases = {};
}
IDManager.prototype = {
get: function IDMgr_get(name) {
if (name in this._aliases)
return this._ids[this._aliases[name]];
if (name in this._ids)
return this._ids[name];
return null;
@ -67,15 +64,6 @@ IDManager.prototype = {
},
del: function IDMgr_del(name) {
delete this._ids[name];
},
getAlias: function IDMgr_getAlias(alias) {
return this._aliases[alias];
},
setAlias: function IDMgr_setAlias(name, alias) {
this._aliases[alias] = name;
},
delAlias: function IDMgr_delAlias(alias) {
delete this._aliases[alias];
}
};