Changeset 14be786c1f5cb85549cba8cc125e57bb40eda4c6
- Timestamp:
- 27/05/08 17:42:48
(5 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1211902968 +0300
- git-parent:
[a043d59ab6243e51b7bbee3a3fc22ab45f2113e8]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1211902968 +0300
- Message:
Simplify vlc_object_find(FIND_ANYWHERE)
We end up looking up from p_libvlc anyway, so we might as well as well
do it from the beginning
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rc865a65 |
r14be786 |
|
| 715 | 715 | /* Otherwise, recursively look for the object */ |
|---|
| 716 | 716 | if( (i_mode & 0x000f) == FIND_ANYWHERE ) |
|---|
| 717 | | { |
|---|
| 718 | | vlc_object_t *p_root = p_this; |
|---|
| 719 | | |
|---|
| 720 | | /* Find the root */ |
|---|
| 721 | | while( p_root->p_parent != NULL && |
|---|
| 722 | | p_root != VLC_OBJECT( p_this->p_libvlc ) ) |
|---|
| 723 | | { |
|---|
| 724 | | p_root = p_root->p_parent; |
|---|
| 725 | | } |
|---|
| 726 | | |
|---|
| 727 | | p_found = FindObject( p_root, i_type, (i_mode & ~0x000f)|FIND_CHILD ); |
|---|
| 728 | | if( p_found == NULL && p_root != VLC_OBJECT( p_this->p_libvlc ) ) |
|---|
| 729 | | { |
|---|
| 730 | | p_found = FindObject( VLC_OBJECT( p_this->p_libvlc ), |
|---|
| 731 | | i_type, (i_mode & ~0x000f)|FIND_CHILD ); |
|---|
| 732 | | } |
|---|
| 733 | | } |
|---|
| | 717 | p_found = FindObject( p_this->p_libvlc, i_type, |
|---|
| | 718 | (i_mode & ~0x000f)|FIND_CHILD ); |
|---|
| 734 | 719 | else |
|---|
| 735 | | { |
|---|
| 736 | 720 | p_found = FindObject( p_this, i_type, i_mode ); |
|---|
| 737 | | } |
|---|
| 738 | 721 | |
|---|
| 739 | 722 | vlc_mutex_unlock( &structure_lock ); |
|---|