Cleaned that method up a bit.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3922 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -56,7 +56,7 @@ public class Streamer
|
|||||||
*/
|
*/
|
||||||
public synchronized static boolean isStreamable (Class target)
|
public synchronized static boolean isStreamable (Class target)
|
||||||
{
|
{
|
||||||
do {
|
while (true) {
|
||||||
// if we've got a streamer for it, it's good
|
// if we've got a streamer for it, it's good
|
||||||
if (_streamers.containsKey(target)) {
|
if (_streamers.containsKey(target)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -65,14 +65,13 @@ public class Streamer
|
|||||||
// if it's an array, check the component type
|
// if it's an array, check the component type
|
||||||
if (target.isArray()) {
|
if (target.isArray()) {
|
||||||
target = target.getComponentType();
|
target = target.getComponentType();
|
||||||
// and loop back around for another go
|
// and loop back around for another check with the comp type...
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while (true);
|
|
||||||
|
|
||||||
// it'll be ok if the type (or component type) is Streamable
|
} else {
|
||||||
return Streamable.class.isAssignableFrom(target);
|
// it'll be ok if the type (or component type) is Streamable
|
||||||
|
return Streamable.class.isAssignableFrom(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user