Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
ad3d6d2c
Commit
ad3d6d2c
authored
Feb 14, 2002
by
Martin Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
([])[0] and ([])["zero"] -> UNDEFINED
Rev: lib/modules/Cache.pmod/cache.pike:1.7
parent
5519b245
Branches
Branches containing commit
Tags
lsh_1.3.3_release_20010830
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Cache.pmod/cache.pike
+4
-4
4 additions, 4 deletions
lib/modules/Cache.pmod/cache.pike
with
4 additions
and
4 deletions
lib/modules/Cache.pmod/cache.pike
+
4
−
4
View file @
ad3d6d2c
...
...
@@ -2,7 +2,7 @@
* A generic cache front-end
* by Francesco Chemolli <kinkie@roxen.com>
*
* $Id: cache.pike,v 1.
6
2002/0
1
/1
5 22:31:23
nilsson Exp $
* $Id: cache.pike,v 1.
7
2002/0
2
/1
4 17:23:12
nilsson Exp $
*
* This module serves as a front-end to different kinds of caching system
* It uses two helper objects to actually store data, and to determine
...
...
@@ -31,7 +31,7 @@ static object(Cache.Policy.Base) policy;
mixed lookup(string key) {
if (!stringp(key)) key=(string)key; // paranoia.
object(Cache.Data) tmp=storage->get(key);
return (tmp?tmp->data():
([])["zero"]
);
return (tmp?tmp->data():
UNDEFINED
);
}
//structure: "key" -> (< ({function,args,0|timeout_call_out_id}) ...>)
...
...
@@ -41,7 +41,7 @@ mixed lookup(string key) {
private mapping (string:multiset(array)) pending_requests=([]);
private void got_results(string key, int|Cache.Data value) {
mixed data=
([])[0]; //undef
mixed data=
UNDEFINED;
if (pending_requests[key]) {
if (value) {
data=value->data();
...
...
@@ -103,7 +103,7 @@ void alookup(string key,
void store(string key, mixed value, void|int max_life,
void|float preciousness, void|multiset(string) dependants ) {
if (!stringp(key)) key=(string)key; // paranoia
multiset(string) rd=
([])[0]
; // real-dependants, after string-check
multiset(string) rd=
UNDEFINED
; // real-dependants, after string-check
if (dependants) {
rd=(<>);
foreach((array)dependants,mixed d) {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment